public class ContentListFacade<T extends Node>
extends java.util.AbstractList<T>
ContentListFacade
represents a facade of the content of a
Branch
which is returned via calls to the Branch.content()
method to allow users to modify the content of a
Branch
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
AbstractBranch instance which owns the content |
private java.util.List<T> |
branchContent
The content of the Branch which is modified if I am modified
|
Constructor and Description |
---|
ContentListFacade(AbstractBranch branch,
java.util.List<T> branchContent) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T node) |
boolean |
add(T node) |
boolean |
addAll(java.util.Collection<? extends T> collection) |
boolean |
addAll(int index,
java.util.Collection<? extends T> collection) |
protected Node |
asNode(java.lang.Object object) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
T |
get(int index) |
protected java.util.List<T> |
getBackingList() |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
int |
lastIndexOf(java.lang.Object o) |
T |
remove(int index) |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> c) |
T |
set(int index,
T node) |
int |
size() |
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] a) |
equals, hashCode, iterator, listIterator, listIterator, removeRange, subList
private java.util.List<T extends Node> branchContent
private AbstractBranch branch
AbstractBranch
instance which owns the contentpublic ContentListFacade(AbstractBranch branch, java.util.List<T> branchContent)
public boolean add(T node)
public void add(int index, T node)
public boolean remove(java.lang.Object object)
public T remove(int index)
public boolean addAll(java.util.Collection<? extends T> collection)
public boolean addAll(int index, java.util.Collection<? extends T> collection)
public void clear()
public boolean removeAll(java.util.Collection<?> c)
public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object o)
public java.lang.Object[] toArray()
public java.lang.Object[] toArray(java.lang.Object[] a)
public boolean containsAll(java.util.Collection<?> c)
public T get(int index)
public int indexOf(java.lang.Object o)
public int lastIndexOf(java.lang.Object o)
protected Node asNode(java.lang.Object object)
protected java.util.List<T> getBackingList()