mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2026-11-02 11:37:37 +00:00
モデル移動
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -1,104 +0,0 @@
|
||||
package one.nem.lacerta.source.file.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class XmlMetaModel {
|
||||
|
||||
String title;
|
||||
String author;
|
||||
String description;
|
||||
// Date created;
|
||||
// Date updated;
|
||||
String defaultBranch;
|
||||
ArrayList<XmlMetaPageModel> pages;
|
||||
|
||||
// Constructor
|
||||
|
||||
public XmlMetaModel() {
|
||||
}
|
||||
|
||||
public XmlMetaModel(String title, String author, String description, String defaultBranch, ArrayList<XmlMetaPageModel> pages) {
|
||||
this.title = title;
|
||||
this.author = author;
|
||||
this.description = description;
|
||||
this.defaultBranch = defaultBranch;
|
||||
this.pages = pages;
|
||||
}
|
||||
|
||||
|
||||
// Getter
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getDefaultBranch() {
|
||||
return defaultBranch;
|
||||
}
|
||||
|
||||
public ArrayList<XmlMetaPageModel> getPages() {
|
||||
return pages;
|
||||
}
|
||||
|
||||
// Setter
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setDefaultBranch(String defaultBranch) {
|
||||
this.defaultBranch = defaultBranch;
|
||||
}
|
||||
|
||||
public void setPages(ArrayList<XmlMetaPageModel> pages) {
|
||||
this.pages = pages;
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
|
||||
public void addPage(XmlMetaPageModel page) {
|
||||
this.pages.add(page);
|
||||
}
|
||||
|
||||
public void addPageAfterIndex(int index, XmlMetaPageModel page) {
|
||||
this.pages.add(index, page);
|
||||
|
||||
//Update index
|
||||
this.updateIndex();
|
||||
}
|
||||
|
||||
public void removePage(XmlMetaPageModel page) {
|
||||
this.pages.remove(page);
|
||||
}
|
||||
|
||||
public void removePageAtIndex(int index) {
|
||||
this.pages.remove(index);
|
||||
|
||||
//Update index
|
||||
this.updateIndex();
|
||||
}
|
||||
|
||||
// Internal Methods
|
||||
private void updateIndex() { // TODO-rca: 効率悪そう
|
||||
for (int i = 0; i < this.pages.size(); i++) {
|
||||
this.pages.get(i).setIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package one.nem.lacerta.source.file.model;
|
||||
|
||||
public class XmlMetaPageModel {
|
||||
|
||||
int index;
|
||||
String filename;
|
||||
|
||||
// Constructor
|
||||
|
||||
public XmlMetaPageModel() {
|
||||
}
|
||||
|
||||
public XmlMetaPageModel(int index, String filename) {
|
||||
this.index = index;
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
// Getter
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
// Setter
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public void setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user