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:
java.lang.Iterable<T>,java.util.Collection<T>,java.util.List<T>
public class ContentListFacade<T extends Node> extends java.util.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.
-
-
Constructor Summary
Constructors Constructor Description ContentListFacade(AbstractBranch branch, java.util.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, java.util.Collection<? extends T> collection)booleanaddAll(java.util.Collection<? extends T> collection)protected NodeasNode(java.lang.Object object)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)Tget(int index)protected java.util.List<T>getBackingList()intindexOf(java.lang.Object o)booleanisEmpty()intlastIndexOf(java.lang.Object o)Tremove(int index)booleanremove(java.lang.Object object)booleanremoveAll(java.util.Collection<?> c)Tset(int index, T node)intsize()java.lang.Object[]toArray()java.lang.Object[]toArray(java.lang.Object[] a)-
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, removeRange, subList
-
-
-
-
Constructor Detail
-
ContentListFacade
public ContentListFacade(AbstractBranch branch, java.util.List<T> branchContent)
-
-
Method Detail
-
add
public boolean add(T node)
-
add
public void add(int index, T node)
-
remove
public boolean remove(java.lang.Object object)
-
remove
public T remove(int index)
-
addAll
public boolean addAll(java.util.Collection<? extends T> collection)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends T> collection)
-
clear
public void clear()
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(java.lang.Object o)
-
toArray
public java.lang.Object[] toArray()
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] a)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
get
public T get(int index)
-
indexOf
public int indexOf(java.lang.Object o)
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
-
asNode
protected Node asNode(java.lang.Object object)
-
getBackingList
protected java.util.List<T> getBackingList()
-
-