Package org.opensaml.core.xml.util
Class ListView<ElementType extends XMLObject>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<ElementType>
-
- org.opensaml.core.xml.util.ListView<ElementType>
-
- Type Parameters:
ElementType- the XMLObject type that this list operates on
- All Implemented Interfaces:
Iterable<ElementType>,Collection<ElementType>,List<ElementType>
class ListView<ElementType extends XMLObject> extends AbstractList<ElementType>
A special list that works as a view of an IndexedXMLObjectChildrenList showing only the sublist associated with a given index. Operations performed on this sublist are reflected in the backing list. Index-based mutation operations are not supported.
-
-
Field Summary
Fields Modifier and Type Field Description private IndexedXMLObjectChildrenList<ElementType>backingListList that backs this view.private QNameindexIndex that points to the list, in the backing list, that this view operates on.private List<ElementType>indexListList, in the backing list, that the given index points to.-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ListView(IndexedXMLObjectChildrenList<ElementType> newBackingList, QName newIndex)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int newIndex, ElementType element)booleanadd(ElementType o)booleanaddAll(int i, Collection<? extends ElementType> c)booleanaddAll(Collection<? extends ElementType> c)voidclear()booleancontains(Object element)Checks to see if the given element is contained in this list.booleancontainsAll(Collection<?> c)ElementTypeget(int newIndex)intindexOf(Object o)booleanisEmpty()intlastIndexOf(Object o)ElementTyperemove(int newIndex)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)ElementTypeset(int newIndex, ElementType element)intsize()Object[]toArray()<T> T[]toArray(T[] a)-
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
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, sort, spliterator
-
-
-
-
Field Detail
-
backingList
private final IndexedXMLObjectChildrenList<ElementType extends XMLObject> backingList
List that backs this view.
-
index
@Nonnull private final QName index
Index that points to the list, in the backing list, that this view operates on.
-
indexList
@Nonnull private List<ElementType extends XMLObject> indexList
List, in the backing list, that the given index points to.
-
-
Constructor Detail
-
ListView
public ListView(@Nonnull IndexedXMLObjectChildrenList<ElementType> newBackingList, @Nonnull QName newIndex)Constructor.- Parameters:
newBackingList- the list that backs this viewnewIndex- the element schema type or name of the sublist this view operates on
-
-
Method Detail
-
add
public boolean add(@Nullable ElementType o)- Specified by:
addin interfaceCollection<ElementType extends XMLObject>- Specified by:
addin interfaceList<ElementType extends XMLObject>- Overrides:
addin classAbstractList<ElementType extends XMLObject>
-
add
public void add(int newIndex, @Nullable ElementType element)- Specified by:
addin interfaceList<ElementType extends XMLObject>- Overrides:
addin classAbstractList<ElementType extends XMLObject>
-
addAll
public boolean addAll(@Nonnull Collection<? extends ElementType> c)- Specified by:
addAllin interfaceCollection<ElementType extends XMLObject>- Specified by:
addAllin interfaceList<ElementType extends XMLObject>- Overrides:
addAllin classAbstractCollection<ElementType extends XMLObject>
-
addAll
public boolean addAll(int i, @Nonnull Collection<? extends ElementType> c)- Specified by:
addAllin interfaceList<ElementType extends XMLObject>- Overrides:
addAllin classAbstractList<ElementType extends XMLObject>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<ElementType extends XMLObject>- Specified by:
clearin interfaceList<ElementType extends XMLObject>- Overrides:
clearin classAbstractList<ElementType extends XMLObject>
-
contains
public boolean contains(Object element)
Checks to see if the given element is contained in this list.- Specified by:
containsin interfaceCollection<ElementType extends XMLObject>- Specified by:
containsin interfaceList<ElementType extends XMLObject>- Overrides:
containsin classAbstractCollection<ElementType extends XMLObject>- Parameters:
element- the element to check for- Returns:
- true if the element is in this list, false if not
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<ElementType extends XMLObject>- Specified by:
containsAllin interfaceList<ElementType extends XMLObject>- Overrides:
containsAllin classAbstractCollection<ElementType extends XMLObject>
-
get
public ElementType get(int newIndex)
- Specified by:
getin interfaceList<ElementType extends XMLObject>- Specified by:
getin classAbstractList<ElementType extends XMLObject>
-
indexOf
public int indexOf(Object o)
- Specified by:
indexOfin interfaceList<ElementType extends XMLObject>- Overrides:
indexOfin classAbstractList<ElementType extends XMLObject>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<ElementType extends XMLObject>- Specified by:
isEmptyin interfaceList<ElementType extends XMLObject>- Overrides:
isEmptyin classAbstractCollection<ElementType extends XMLObject>
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<ElementType extends XMLObject>- Overrides:
lastIndexOfin classAbstractList<ElementType extends XMLObject>
-
remove
@Nonnull public ElementType remove(int newIndex)
- Specified by:
removein interfaceList<ElementType extends XMLObject>- Overrides:
removein classAbstractList<ElementType extends XMLObject>
-
remove
public boolean remove(@Nullable Object o)- Specified by:
removein interfaceCollection<ElementType extends XMLObject>- Specified by:
removein interfaceList<ElementType extends XMLObject>- Overrides:
removein classAbstractCollection<ElementType extends XMLObject>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<ElementType extends XMLObject>- Specified by:
removeAllin interfaceList<ElementType extends XMLObject>- Overrides:
removeAllin classAbstractCollection<ElementType extends XMLObject>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<ElementType extends XMLObject>- Specified by:
retainAllin interfaceList<ElementType extends XMLObject>- Overrides:
retainAllin classAbstractCollection<ElementType extends XMLObject>
-
set
public ElementType set(int newIndex, @Nonnull ElementType element)
- Specified by:
setin interfaceList<ElementType extends XMLObject>- Overrides:
setin classAbstractList<ElementType extends XMLObject>
-
size
public int size()
- Specified by:
sizein interfaceCollection<ElementType extends XMLObject>- Specified by:
sizein interfaceList<ElementType extends XMLObject>- Specified by:
sizein classAbstractCollection<ElementType extends XMLObject>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<ElementType extends XMLObject>- Specified by:
toArrayin interfaceList<ElementType extends XMLObject>- Overrides:
toArrayin classAbstractCollection<ElementType extends XMLObject>
-
toArray
public <T> T[] toArray(@Nonnull T[] a)- Specified by:
toArrayin interfaceCollection<ElementType extends XMLObject>- Specified by:
toArrayin interfaceList<ElementType extends XMLObject>- Overrides:
toArrayin classAbstractCollection<ElementType extends XMLObject>
-
-