Package com.tangosol.run.xml
Class SimpleElement.ElementList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList
-
- com.tangosol.run.xml.SimpleElement.ElementList
-
- All Implemented Interfaces:
ExternalizableLite,Serializable,Cloneable,Iterable,Collection,List,RandomAccess
- Enclosing class:
- SimpleElement
protected class SimpleElement.ElementList extends ArrayList implements ExternalizableLite
An implementation of List that only supports XmlElements as the content of the List.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedElementList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Object element)Inserts the specified element at the specified position in this list.booleanadd(Object o)Appends the specified element to the end of this list.booleanaddAll(int index, Collection c)Overrides the ArrayList implementation to force this throw the single object add() method.booleanaddAll(Collection c)Overrides the ArrayList implementation to force this throw the single object add() method.protected XmlElementcheckElement(XmlElement element)Validates the passed XmlElement, copying the element into a new valid element if necessary.voidclear()Removes all of the elements from this list.voidreadExternal(DataInput in)Restore the contents of this object by loading the object's state from the passed DataInput object.Objectremove(int index)Removes the element at the specified position in this list.Objectset(int index, Object element)Replaces the element at the specified position in this list with the specified element.voidwriteExternal(DataOutput out)Save the contents of this object by storing the object's state into the passed DataOutput object.-
Methods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Method Detail
-
set
public Object set(int index, Object element)
Replaces the element at the specified position in this list with the specified element.- Specified by:
setin interfaceList- Overrides:
setin classArrayList- Parameters:
index- index of element to replace.element- element to be stored at the specified position.- Returns:
- the element previously at the specified position.
- Throws:
IndexOutOfBoundsException- if index out of range (index < 0 || index >= size()).
-
add
public boolean add(Object o)
Appends the specified element to the end of this list.
-
add
public void add(int index, Object element)Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).- Specified by:
addin interfaceList- Overrides:
addin classArrayList- Parameters:
index- index at which the specified element is to be inserted.element- element to be inserted.- Throws:
IndexOutOfBoundsException- if index is out of range (index < 0 || index > size()).
-
remove
public Object remove(int index)
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).- Specified by:
removein interfaceList- Overrides:
removein classArrayList- Parameters:
index- the index of the element to removed.- Returns:
- the element that was removed from the list.
- Throws:
IndexOutOfBoundsException- if index out of range (index < 0 || index >= size()).
-
clear
public void clear()
Removes all of the elements from this list. The list will be empty after this call returns.
-
addAll
public boolean addAll(Collection c)
Overrides the ArrayList implementation to force this throw the single object add() method.
-
addAll
public boolean addAll(int index, Collection c)Overrides the ArrayList implementation to force this throw the single object add() method.
-
checkElement
protected XmlElement checkElement(XmlElement element)
Validates the passed XmlElement, copying the element into a new valid element if necessary.- Parameters:
element- the XML element- Returns:
- a XML element, copying if necessary
-
readExternal
public void readExternal(DataInput in) throws IOException
Description copied from interface:ExternalizableLiteRestore the contents of this object by loading the object's state from the passed DataInput object.- Specified by:
readExternalin interfaceExternalizableLite- Parameters:
in- the DataInput stream to read data from in order to restore the state of this object- Throws:
IOException- if an I/O exception occursNotActiveException- if the object is not in its initial state, and therefore cannot be deserialized into
-
writeExternal
public void writeExternal(DataOutput out) throws IOException
Description copied from interface:ExternalizableLiteSave the contents of this object by storing the object's state into the passed DataOutput object.- Specified by:
writeExternalin interfaceExternalizableLite- Parameters:
out- the DataOutput stream to write the state of this object to- Throws:
IOException- if an I/O exception occurs
-
-