|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
com.pepper.platform.program.PageList
public class PageList
Linked list of Pages. Note - code iterating and/or modifying
instances of this class must externally synchronize on the instance
lock. eg.
PageList pages = section.getPages();
synchronized(pages) {
for (int i = 0; i < pages.size(); i++) {
Page = pages.getPage(x);
...
}
}
Section
,
Serialized FormField Summary | |
---|---|
static int |
DEFAULT_CAPACITY
Default Capacity |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
PageList(com.pepper.platform.program.PageIndex pageIndex)
Creates a new PageList instance. |
Method Summary | |
---|---|
int |
add(int index,
Page page,
Section section)
insert the item in the list and return the actual position where it was inserted (will be same as index passed in unless index was too big, in which case it will be added to the end of the list) |
boolean |
add(Object obj)
Adds an orphan page (ie doesn't belong to a section) to the end of the PageList and to the PageIndex . |
boolean |
add(Page page,
Section section)
Adds a page to end of the PageList and to the PageIndex
with the specified section. |
boolean |
contains(Object obj)
Override to only check the page id. |
Page |
getPage(int index)
Returns the page specified by the given index. |
Page |
getPage(String pageId)
Returns the page specified by the given id. |
int |
getPageIndex(String pageId)
Returns the page index specified by the given id. |
List |
getPageListAsXml()
Returns all of the pages in this instance as List of
JDOM XML Element instances. |
Object |
remove(int index)
Removes the specified page from the PageList and
PageIndex . |
Object |
remove(int index,
boolean clearPageIndex)
|
boolean |
remove(Object obj)
Removes the specified page from the PageList and
PageIndex . |
int |
remove(String pageId)
Delete based on the pageId of the page |
void |
setPageIndex(com.pepper.platform.program.PageIndex pageIndex)
Sets the PageIndex instance of this list. |
String |
toString()
Debug method to dump contents of a PageList as
a String . |
Methods inherited from class java.util.ArrayList |
---|
add, addAll, addAll, clear, clone, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Field Detail |
---|
public static final int DEFAULT_CAPACITY
Constructor Detail |
---|
public PageList(com.pepper.platform.program.PageIndex pageIndex)
PageList
instance.
Method Detail |
---|
public boolean contains(Object obj)
contains
in interface Collection
contains
in interface List
contains
in class ArrayList
obj
- an Object
instance.
boolean
value.public void setPageIndex(com.pepper.platform.program.PageIndex pageIndex)
PageIndex
instance of this list.
pageIndex
- a PageIndex
instance.public Page getPage(int index)
index
- an int
value containing the page's index.
Page
instance.public Page getPage(String pageId)
pageId
- an String
value containing the page's id.
Page
instance.public int getPageIndex(String pageId)
pageId
- an String
value containing the page's id.
public boolean add(Object obj)
PageList
and to the PageIndex
.
add
in interface Collection
add
in interface List
add
in class ArrayList
obj
- an Object
value
true
(as per the general contract of
Collection.add
).public boolean add(Page page, Section section)
PageList
and to the PageIndex
with the specified section.
page
- a Page
value.section
- the owning Section
.
true
(as per the general contract of
Collection.add
).public int add(int index, Page page, Section section)
index
- an int
valuepage
- a Page
valuesection
- a Section
value
int
valuepublic int remove(String pageId)
pageId
- a String
value
boolean
valuepublic Object remove(int index)
PageList
and
PageIndex
.
remove
in interface List
remove
in class ArrayList
index
- an int
value specifying the page's index.
Object
instance containing the removed Page
.public Object remove(int index, boolean clearPageIndex)
public boolean remove(Object obj)
PageList
and
PageIndex
.
remove
in interface Collection
remove
in interface List
remove
in class ArrayList
obj
- an Object
instance containing the Page
instance to be removed.
boolean
value indicating whether or not the
Page
was successfully removed.public List getPageListAsXml()
List
of
JDOM XML Element
instances.
List
of JDOM Elements
.public String toString()
PageList
as
a String
.
toString
in class AbstractCollection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |