|
||||||||||
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>
ElementType
- type of elements added to the listpublic class XMLObjectChildrenList<ElementType extends XMLObject>
Resizable list for the children of XMLObjects. This list implements all optional List operations and does not all for null elements. XMLObjects added to, or removed from, this list will have their parent object appropriately set and, the underlying DOM will be released during mutation opertions.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
XMLObjectChildrenList(XMLObject newParent)
Constructs an empty list with all added XMLObjects being assigned the given parent XMLObject. |
|
XMLObjectChildrenList(XMLObject newParent,
Collection<ElementType> newElements)
Constructs a list containing the elements in the specified collection, in the order they are returned by the collection's iterator, with each added XMLObject assigned the given parent XMLObject. |
Method Summary | |
---|---|
void |
add(int index,
ElementType element)
Adds the given XMLObject to this list. |
boolean |
contains(ElementType element)
Checks to see if the given element is contained in this list. |
ElementType |
get(int index)
|
boolean |
remove(ElementType element)
Removes the element from the list. |
ElementType |
remove(int index)
|
ElementType |
set(int index,
ElementType element)
Replaces the XMLObject at the specified index with the given element. |
protected void |
setParent(ElementType element)
Assigned the parent, given at list construction, to the given element if the element does not have a parent or its parent matches the one given at list construction time. |
int |
size()
|
Methods inherited from class java.util.AbstractList |
---|
add, addAll, clear, 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 |
Constructor Detail |
---|
public XMLObjectChildrenList(XMLObject newParent) throws NullPointerException
newParent
- the parent for all the added XMLObjects
NullPointerException
- thrown if the parent is nullpublic XMLObjectChildrenList(XMLObject newParent, Collection<ElementType> newElements) throws NullPointerException
newParent
- the parent for all the added XMLObjectsnewElements
- the elements to be added
NullPointerException
- thrown if the parent is null
IllegalArgumentException
- thrown if any of the XMLObjects in the given collection already have a parent
that is different from the given parentMethod Detail |
---|
public int size()
size
in interface Collection<ElementType extends XMLObject>
size
in interface List<ElementType extends XMLObject>
size
in class AbstractCollection<ElementType extends XMLObject>
public boolean contains(ElementType element)
element
- the element to check for
public ElementType get(int index)
get
in interface List<ElementType extends XMLObject>
get
in class AbstractList<ElementType extends XMLObject>
public ElementType set(int index, ElementType element) throws IllegalArgumentException
set
in interface List<ElementType extends XMLObject>
set
in class AbstractList<ElementType extends XMLObject>
index
- index of the XMLObject to be replacedelement
- element to be stored at the given index
IllegalArgumentException
- thrown if the given XMLObject already has a parent that is different from the
XMLObject given at list construction timepublic void add(int index, ElementType element) throws IllegalArgumentException
add
in interface List<ElementType extends XMLObject>
add
in class AbstractList<ElementType extends XMLObject>
index
- index at which to add the given XMLObjectelement
- element to be stored at the given index
IllegalArgumentException
- thrown if the given XMLObject already has a parent that is different from the
XMLObject given at list construction timepublic ElementType remove(int index)
remove
in interface List<ElementType extends XMLObject>
remove
in class AbstractList<ElementType extends XMLObject>
public boolean remove(ElementType element)
element
- the element to be removed
protected void setParent(ElementType element) throws IllegalArgumentException
element
- the element to set the parent on
IllegalArgumentException
- thrown if the given element already has a parent and it is different than the
parent given at list construction time
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |