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 Map<QName,List<ElementType>> |
objectIndex
Index of objects by type and name.
|
modCount| Constructor and Description |
|---|
IndexedXMLObjectChildrenList(XMLObject parent)
Constructor.
|
IndexedXMLObjectChildrenList(XMLObject parent,
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(QName index)
Check for the existence of an index for the specified QName and create it
if it doesn't exist.
|
void |
clear() |
List<ElementType> |
get(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(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(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.
|
List<? extends ElementType> |
subList(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, toStringprivate final Map<QName,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 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 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 Collection<ElementType extends XMLObject>clear in interface List<ElementType extends XMLObject>clear in class AbstractList<ElementType extends XMLObject>@Nonnull public List<ElementType> get(@Nonnull QName typeOrName)
typeOrName - the schema type or element nameprotected void checkAndCreateIndex(@Nonnull QName index)
index - the index to checkprotected void indexElement(@Nullable ElementType element)
element - the SAMLObject to indexprotected void indexElement(@Nonnull 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 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 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 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 List<? extends ElementType> subList(@Nonnull QName index)
index - index of the elements returned in the list viewCopyright © 1999–2014. All rights reserved.