mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
操作メソッド追加
This commit is contained in:
parent
5ff6ac32ba
commit
a4db519fcf
|
@ -71,4 +71,35 @@ public class XmlMetaModel {
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user