Package org.dom4j.tree
Class ContentListFacade<T extends Node>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- org.dom4j.tree.ContentListFacade<T>
-
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,List<T>
public class ContentListFacade<T extends Node> extends AbstractList<T>
ContentListFacade
represents a facade of the content of aBranch
which is returned via calls to theBranch.content()
method to allow users to modify the content of aBranch
directly using theList
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.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ContentListFacade(AbstractBranch branch, List<T> branchContent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, T node)
boolean
add(T node)
boolean
addAll(int index, Collection<? extends T> collection)
boolean
addAll(Collection<? extends T> collection)
protected Node
asNode(Object object)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
T
get(int index)
protected List<T>
getBackingList()
int
indexOf(Object o)
boolean
isEmpty()
int
lastIndexOf(Object o)
T
remove(int index)
boolean
remove(Object object)
boolean
removeAll(Collection<?> c)
T
set(int index, T node)
int
size()
Object[]
toArray()
Object[]
toArray(Object[] a)
-
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
retainAll, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, retainAll, sort, spliterator
-
-
-
-
Constructor Detail
-
ContentListFacade
public ContentListFacade(AbstractBranch branch, List<T> branchContent)
-
-
Method Detail
-
add
public boolean add(T node)
-
add
public void add(int index, T node)
-
remove
public boolean remove(Object object)
-
remove
public T remove(int index)
-
addAll
public boolean addAll(Collection<? extends T> collection)
-
addAll
public boolean addAll(int index, Collection<? extends T> collection)
-
clear
public void clear()
-
removeAll
public boolean removeAll(Collection<?> c)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
toArray
public Object[] toArray()
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<T extends Node>
- Specified by:
containsAll
in interfaceList<T extends Node>
- Overrides:
containsAll
in classAbstractCollection<T extends Node>
-
get
public T get(int index)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<T extends Node>
- Overrides:
lastIndexOf
in classAbstractList<T extends Node>
-
-