Package org.apache.xmlbeans
Class XmlSimpleList<T>
- java.lang.Object
-
- org.apache.xmlbeans.XmlSimpleList<T>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<T>,java.util.Collection<T>,java.util.List<T>
public class XmlSimpleList<T> extends java.lang.Object implements java.util.List<T>, java.io.SerializableThe immutableListreturned for XML simple list values.XmlSimpleList implements an equals() and hashCode() that compare list contents, so two XmlSimpleLists are the same if they have the same values in the same order.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XmlSimpleList(java.util.List<T> list)Constructs an immutable XmlSimpleList that wraps (does not copy) the givenList.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, java.lang.Object element)Unsupported because this list is immutable.booleanadd(java.lang.Object o)Unsupported because this list is immutable.booleanaddAll(int index, java.util.Collection c)Unsupported because this list is immutable.booleanaddAll(java.util.Collection coll)Unsupported because this list is immutable.voidclear()Unsupported because this list is immutable.booleancontains(java.lang.Object o)True if the list is contains an object equal to o.booleancontainsAll(java.util.Collection coll)True if the list is contains all the objects in the given collection.booleanequals(java.lang.Object o)Two XmlSimpleLists are equal if all their items are equal.Tget(int index)Returns the object at the specified position in this list.inthashCode()Combines the hash codes of all the list items.intindexOf(java.lang.Object o)Returns index of the first occurance of an object equal to o.booleanisEmpty()True if the list is empty.java.util.Iterator<T>iterator()Returns an iterator over the elements in this list in proper sequence.intlastIndexOf(java.lang.Object o)Returns index of the last occurance of an object equal to o.java.util.ListIterator<T>listIterator()Returns a list iterator of the elements in this list in proper sequence.java.util.ListIterator<T>listIterator(int index)Returns a list iterator of the elements in this list in proper sequence, starting at the specified position in this list.Tremove(int index)Unsupported because this list is immutable.booleanremove(java.lang.Object o)Unsupported because this list is immutable.booleanremoveAll(java.util.Collection coll)Unsupported because this list is immutable.booleanretainAll(java.util.Collection coll)Unsupported because this list is immutable.Tset(int index, T element)Unsupported because this list is immutable.intsize()Returns the number of elements in this list.java.util.List<T>subList(int from, int to)Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.java.lang.Object[]toArray()Copies the collection to an array.<X> X[]toArray(X[] a)Copies the collection to an array of a specified type.java.lang.StringtoString()Returns a space-separated list of the string representations of all the items in the list.
-
-
-
Constructor Detail
-
XmlSimpleList
public XmlSimpleList(java.util.List<T> list)
Constructs an immutable XmlSimpleList that wraps (does not copy) the givenList. All non-mutating methods delegate to the underlying List instance.
-
-
Method Detail
-
size
public int size()
Returns the number of elements in this list.
-
isEmpty
public boolean isEmpty()
True if the list is empty.
-
contains
public boolean contains(java.lang.Object o)
True if the list is contains an object equal to o.
-
containsAll
public boolean containsAll(java.util.Collection coll)
True if the list is contains all the objects in the given collection.
-
toArray
public java.lang.Object[] toArray()
Copies the collection to an array.
-
toArray
public <X> X[] toArray(X[] a)
Copies the collection to an array of a specified type.
-
add
public boolean add(java.lang.Object o)
Unsupported because this list is immutable.
-
addAll
public boolean addAll(java.util.Collection coll)
Unsupported because this list is immutable.
-
remove
public boolean remove(java.lang.Object o)
Unsupported because this list is immutable.
-
removeAll
public boolean removeAll(java.util.Collection coll)
Unsupported because this list is immutable.
-
retainAll
public boolean retainAll(java.util.Collection coll)
Unsupported because this list is immutable.
-
clear
public void clear()
Unsupported because this list is immutable.
-
get
public T get(int index)
Returns the object at the specified position in this list.- Specified by:
getin interfacejava.util.List<T>
-
set
public T set(int index, T element)
Unsupported because this list is immutable.- Specified by:
setin interfacejava.util.List<T>
-
add
public void add(int index, java.lang.Object element)Unsupported because this list is immutable.- Specified by:
addin interfacejava.util.List<T>
-
remove
public T remove(int index)
Unsupported because this list is immutable.- Specified by:
removein interfacejava.util.List<T>
-
indexOf
public int indexOf(java.lang.Object o)
Returns index of the first occurance of an object equal to o.- Specified by:
indexOfin interfacejava.util.List<T>
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
Returns index of the last occurance of an object equal to o.- Specified by:
lastIndexOfin interfacejava.util.List<T>
-
addAll
public boolean addAll(int index, java.util.Collection c)Unsupported because this list is immutable.- Specified by:
addAllin interfacejava.util.List<T>
-
subList
public java.util.List<T> subList(int from, int to)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.- Specified by:
subListin interfacejava.util.List<T>
-
iterator
public java.util.Iterator<T> iterator()
Returns an iterator over the elements in this list in proper sequence.
-
listIterator
public java.util.ListIterator<T> listIterator()
Returns a list iterator of the elements in this list in proper sequence.- Specified by:
listIteratorin interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator(int index)
Returns a list iterator of the elements in this list in proper sequence, starting at the specified position in this list.- Specified by:
listIteratorin interfacejava.util.List<T>
-
toString
public java.lang.String toString()
Returns a space-separated list of the string representations of all the items in the list. For most lists, this is a valid xml lexical value for the list. (The notable exception is a list of QNames.)- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Two XmlSimpleLists are equal if all their items are equal. (They must have the same number of items, and the items must be in the same order.)
-
-