public class ContentElementList extends java.lang.Object implements ContentElement
Constructor and Description |
---|
ContentElementList()
Construct a ContentElementList object
|
Modifier and Type | Method and Description |
---|---|
void |
add(ContentElement element)
Adds a new element (that must be a content element) to this
content element list.
|
void |
clear()
Clear all the elements in this content element list.
|
boolean |
contains(ContentElement element)
Test if a given content element is contained in this
content element list.
|
ContentElement |
get(int i)
Retrieves the
i -th element in this content element list. |
int |
indexOf(ContentElement element)
Returns the position of an element within this content element list.
|
boolean |
isEmpty()
Test if the content element list is empty.
|
Iterator |
iterator() |
ContentElement |
remove(int index)
Removes the element at the given position from this content
element list.
|
int |
size()
Retrieves the number of elements in this content element list.
|
ContentElement[] |
toArray()
Retrieve all elements in this content element list in the form of
an array.
|
public ContentElementList()
public void add(ContentElement element)
element
- The element to add.public int size()
public ContentElement get(int i)
i
-th element in this content element list.i
- The index of the element to retrieve.public Iterator iterator()
Iterator
over the elements of this
content element list.public void clear()
public boolean contains(ContentElement element)
true
if the given content element is contained
in this content element list.public int indexOf(ContentElement element)
public ContentElement remove(int index)
public boolean isEmpty()
true
if this content element list does
not contain any element.public ContentElement[] toArray()