ContentListFacade represents a facade of the content of a
org. which is returned via calls to the org. method to allow users to modify the content of a
org. directly using the List interface. This list
is backed by the branch such that changes to the list will be reflected in
the branch and changes to the branch will be reflected in this list.
| Modifier and Type | Field and Description |
|---|---|
| private AbstractBranch | branch
The |
| private List | branchContent
The content of the Branch which is modified if I am modified |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(T
element to be appended to this list node)Overrides java. Implements java. |
| public void | add(int
index at which the specified element is to be inserted index, T element to be inserted node)Overrides java. Implements java. |
| public boolean | addAll(Collection<? extends T>
collection containing elements to be added to this list collection)Overrides java. Implements java. |
| public boolean | addAll(int
index at which to insert the first element from the
specified collection index, Collection<? extends T> collection containing elements to be added to this list collection)Overrides java. Implements java. |
| protected Node | |
| public void | clear()
Overrides java. Implements java. |
| public boolean | contains(Object
element whose presence in this list is to be tested o)Overrides java. Implements java. true if this list contains the specified element.
|
| public boolean | containsAll(Collection<?>
collection to be checked for containment in this list c)Overrides java. Implements java. true if this list contains all of the elements of the
specified collection.
|
| public T | get(int
index of the element to return index)Implements abstract java. Implements java. |
| protected List | |
| public int | indexOf(Object
element to search for o)Overrides java. Implements java. |
| public boolean | isEmpty()
Overrides java. Implements java. true if this list contains no elements.
|
| public int | lastIndexOf(Object
element to search for o)Overrides java. Implements java. |
| public boolean | remove(Object
element to be removed from this list, if present object)Overrides java. Implements java. |
| public T | remove(int
the index of the element to be removed index)Overrides java. Implements java. |
| public boolean | removeAll(Collection<?>
collection containing elements to be removed from this list c)Overrides java. Implements java. |
| public T | set(int
index of the element to replace index, T element to be stored at the specified position node)Overrides java. Implements java. |
| public int | size()
Implements abstract java. Implements java. |
| public Object[] | toArray()
Overrides java. Implements java. |
| public Object[] | toArray(Object[]
the array into which the elements of this list are to
be stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose. a)Overrides java. Implements java. |
| branch | back to summary |
|---|---|
| private AbstractBranch branch The | |
| branchContent | back to summary |
|---|---|
| private List<T> branchContent The content of the Branch which is modified if I am modified | |
| ContentListFacade | back to summary |
|---|---|
| public ContentListFacade(AbstractBranch branch, List<T> branchContent) | |
| add | back to summary |
|---|---|
| public boolean add(T node) Overrides java. Implements java. Doc from java. Appends the specified element to the end of this list (optional operation). Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.
| |
| add | back to summary |
|---|---|
| public void add(int index, T node) Overrides java. Implements java. Doc from java. Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(Collection<? extends T> collection) Overrides java. Implements java. Doc from java. Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(int index, Collection<? extends T> collection) Overrides java. Implements java. Doc from java. Inserts all of the elements in the specified collection into this list at the specified position (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
| |
| asNode | back to summary |
|---|---|
| protected Node asNode(Object object) | |
| clear | back to summary |
|---|---|
| public void clear() Overrides java. Implements java. Doc from java. Removes all of the elements from this list (optional operation). The list will be empty after this call returns.
| |
| contains | back to summary |
|---|---|
| public boolean contains(Object o) Overrides java. Implements java. Doc from java. Returns | |
| containsAll | back to summary |
|---|---|
| public boolean containsAll(Collection<?> c) Overrides java. Implements java. Doc from java. Returns
| |
| get | back to summary |
|---|---|
| public T get(int index) Implements abstract java. Implements java. Doc from java. Returns the element at the specified position in this list.
| |
| getBackingList | back to summary |
|---|---|
| protected List | |
| indexOf | back to summary |
|---|---|
| public int indexOf(Object o) Overrides java. Implements java. Doc from java. Returns the index of the first occurrence of the specified element
in this list, or -1 if this list does not contain the element.
More formally, returns the lowest index
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Overrides java. Implements java. Doc from java. Returns
| |
| lastIndexOf | back to summary |
|---|---|
| public int lastIndexOf(Object o) Overrides java. Implements java. Doc from java. Returns the index of the last occurrence of the specified element
in this list, or -1 if this list does not contain the element.
More formally, returns the highest index
| |
| remove | back to summary |
|---|---|
| public boolean remove(Object object) Overrides java. Implements java. Doc from java. Removes the first occurrence of the specified element from this list,
if it is present (optional operation). If this list does not contain
the element, it is unchanged. More formally, removes the element with
the lowest index | |
| remove | back to summary |
|---|---|
| public T remove(int index) Overrides java. Implements java. Doc from java. Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(Collection<?> c) Overrides java. Implements java. Doc from java. Removes from this list all of its elements that are contained in the specified collection (optional operation).
| |
| set | back to summary |
|---|---|
| public T set(int index, T node) Overrides java. Implements java. Doc from java. Replaces the element at the specified position in this list with the specified element (optional operation).
| |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this list. If this list contains
more than
| |
| toArray | back to summary |
|---|---|
| public Object[] toArray() Overrides java. Implements java. Doc from java. Returns an array containing all of the elements in this list in proper sequence (from first to last element). The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array even if this list is backed by an array). The caller is thus free to modify the returned array. This method acts as bridge between array-based and collection-based APIs. | |
| toArray | back to summary |
|---|---|
| public Object[] toArray(Object[] a) Overrides java. Implements java. Doc from java. Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list. If the list fits in the specified array with room to spare (i.e.,
the array has more elements than the list), the element in the array
immediately following the end of the list is set to Like the Suppose
Note that toArray(new Object[0]) is identical in function to
toArray().
| |