|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<ElementType> org.opensaml.xml.util.XMLObjectChildrenList<ElementType> org.opensaml.xml.util.IndexedXMLObjectChildrenList<ElementType>
ElementType
- the type of element added to the list@NotThreadSafe public class IndexedXMLObjectChildrenList<ElementType extends XMLObject>
A list which indexes XMLObjects by their schema type and element QName for quick retrival based on those items.
Field Summary | |
---|---|
private Map<QName,List<ElementType>> |
objectIndex
Index of objects by type and name. |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
IndexedXMLObjectChildrenList(XMLObject parent)
Constructor. |
|
IndexedXMLObjectChildrenList(XMLObject parent,
Collection<ElementType> col)
Constructor. |
Method Summary | |
---|---|
void |
add(int index,
ElementType element)
Inserts the specified element at the specified position in 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. |
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)
Removes the element at the specified position in this list. |
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 element at the specified position in this list with the specified element. |
List<? extends ElementType> |
subList(QName index)
Returns a view of the list that only contains elements stored under the given index. |
Methods inherited from class org.opensaml.xml.util.XMLObjectChildrenList |
---|
contains, get, setParent, size |
Methods inherited from class java.util.AbstractList |
---|
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Field Detail |
---|
private Map<QName,List<ElementType extends XMLObject>> objectIndex
Constructor Detail |
---|
public IndexedXMLObjectChildrenList(XMLObject parent)
parent
- the parent of the XMLObject
s added to the listpublic IndexedXMLObjectChildrenList(XMLObject parent, Collection<ElementType> col)
parent
- the parent of all elementscol
- collection to add to this listMethod Detail |
---|
public void add(int index, ElementType element)
add
in interface List<ElementType extends XMLObject>
add
in class XMLObjectChildrenList<ElementType extends XMLObject>
index
- index of element to addelement
- element to be stored at the specified positionpublic void clear()
clear
in interface Collection<ElementType extends XMLObject>
clear
in interface List<ElementType extends XMLObject>
clear
in class AbstractList<ElementType extends XMLObject>
public List<ElementType> get(QName typeOrName)
typeOrName
- the schema type or element name
protected void checkAndCreateIndex(QName index)
index
- the index to checkprotected void indexElement(ElementType element)
element
- the SAMLObject to indexprotected void indexElement(QName index, ElementType element)
index
- the index for the elementelement
- the element to be indexedpublic boolean remove(ElementType element)
remove
in class XMLObjectChildrenList<ElementType extends XMLObject>
element
- the element to be removed
public ElementType remove(int index)
remove
in interface List<ElementType extends XMLObject>
remove
in class XMLObjectChildrenList<ElementType extends XMLObject>
index
- the index of the element to remove
protected void removeElementFromIndex(ElementType element)
element
- the element to remove from the indexprotected void removeElementFromIndex(QName index, ElementType element)
index
- the id of the indexelement
- the element to be removed from that indexpublic ElementType set(int index, ElementType element)
set
in interface List<ElementType extends XMLObject>
set
in class XMLObjectChildrenList<ElementType extends XMLObject>
index
- index of element to replaceelement
- element to be stored at the specified position
public List<? extends ElementType> subList(QName index)
index
- index of the elements returned in the list view
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |