ElementType - the type of element added to the list@NotThreadSafe public class IndexedXMLObjectChildrenList<ElementType extends XMLObject> extends XMLObjectChildrenList<ElementType>
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<javax.xml.namespace.QName,java.util.List<ElementType>> |
objectIndex
Index of objects by type and name.
|
| Constructor and Description |
|---|
IndexedXMLObjectChildrenList(XMLObject parent)
Constructor.
|
IndexedXMLObjectChildrenList(XMLObject parent,
java.util.Collection<ElementType> col)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
ElementType element)
Adds the given XMLObject to this list.
|
protected void |
checkAndCreateIndex(javax.xml.namespace.QName index)
Check for the existence of an index for the specified QName and create it
if it doesn't exist.
|
void |
clear() |
java.util.List<ElementType> |
get(javax.xml.namespace.QName typeOrName)
Retrieves all the SAMLObjects that have given schema type or element name, or a
null if no such objects exist.
|
protected void |
indexElement(ElementType element)
Indexes the given SAMLObject by type and element name.
|
protected void |
indexElement(javax.xml.namespace.QName index,
ElementType element)
Indexes the given SAMLobject by the given index.
|
boolean |
remove(ElementType element)
Removes a given element from the list and index.
|
ElementType |
remove(int index) |
protected void |
removeElementFromIndex(ElementType element)
Removes the given element from the schema type and element QName index.
|
protected void |
removeElementFromIndex(javax.xml.namespace.QName index,
ElementType element)
Removes an object from the given index id.
|
ElementType |
set(int index,
ElementType element)
Replaces the XMLObject at the specified index with the given element.
|
java.util.List<? extends ElementType> |
subList(javax.xml.namespace.QName index)
Returns a view of the list that only contains elements stored under the given index.
|
contains, get, setParent, sizeadd, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitprivate final java.util.Map<javax.xml.namespace.QName,java.util.List<ElementType extends XMLObject>> objectIndex
public IndexedXMLObjectChildrenList(@Nonnull
XMLObject parent)
parent - the parent of the XMLObjects added to the listpublic IndexedXMLObjectChildrenList(@Nonnull
XMLObject parent,
@Nonnull
java.util.Collection<ElementType> col)
parent - the parent of all elementscol - collection to add to this listpublic void add(int index,
@Nullable
ElementType element)
An IllegalArgumentException is thrown if the given XMLObject already has a parent other than the parent given at list construction time.
add in interface java.util.List<ElementType extends XMLObject>add in class XMLObjectChildrenList<ElementType extends XMLObject>index - index at which to add the given XMLObjectelement - element to be stored at the given indexpublic void clear()
clear in interface java.util.Collection<ElementType extends XMLObject>clear in interface java.util.List<ElementType extends XMLObject>clear in class java.util.AbstractList<ElementType extends XMLObject>@Nonnull public java.util.List<ElementType> get(@Nonnull javax.xml.namespace.QName typeOrName)
typeOrName - the schema type or element nameprotected void checkAndCreateIndex(@Nonnull
javax.xml.namespace.QName index)
index - the index to checkprotected void indexElement(@Nullable
ElementType element)
element - the SAMLObject to indexprotected void indexElement(@Nonnull
javax.xml.namespace.QName index,
@Nullable
ElementType element)
index - the index for the elementelement - the element to be indexedpublic boolean remove(@Nullable
ElementType element)
remove in class XMLObjectChildrenList<ElementType extends XMLObject>element - the element to be removed@Nonnull public ElementType remove(int index)
remove in interface java.util.List<ElementType extends XMLObject>remove in class XMLObjectChildrenList<ElementType extends XMLObject>protected void removeElementFromIndex(@Nullable
ElementType element)
element - the element to remove from the indexprotected void removeElementFromIndex(@Nonnull
javax.xml.namespace.QName index,
@Nullable
ElementType element)
index - the id of the indexelement - the element to be removed from that index@Nullable public ElementType set(int index, @Nullable ElementType element)
An IllegalArgumentException is thrown if the given XMLObject already has a parent other than the parent given at list construction time.
set in interface java.util.List<ElementType extends XMLObject>set in class XMLObjectChildrenList<ElementType extends XMLObject>index - index of the XMLObject to be replacedelement - element to be stored at the given index@Nonnull public java.util.List<? extends ElementType> subList(@Nonnull javax.xml.namespace.QName index)
index - index of the elements returned in the list view