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>
ContentListFacaderepresents a facade of the content of aBranchwhich is returned via calls to theBranch.content()method to allow users to modify the content of aBranchdirectly using theListinterface. 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 voidadd(int index, T node)booleanadd(T node)booleanaddAll(int index, Collection<? extends T> collection)booleanaddAll(Collection<? extends T> collection)protected NodeasNode(Object object)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)Tget(int index)protected List<T>getBackingList()intindexOf(Object o)booleanisEmpty()intlastIndexOf(Object o)Tremove(int index)booleanremove(Object object)booleanremoveAll(Collection<?> c)Tset(int index, T node)intsize()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:
containsAllin interfaceCollection<T extends Node>- Specified by:
containsAllin interfaceList<T extends Node>- Overrides:
containsAllin classAbstractCollection<T extends Node>
-
get
public T get(int index)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<T extends Node>- Overrides:
lastIndexOfin classAbstractList<T extends Node>
-
-