Package org.apache.xmlbeans
Class XmlSimpleList
- java.lang.Object
-
- org.apache.xmlbeans.XmlSimpleList
-
- All Implemented Interfaces:
Serializable,Iterable,Collection,List
public class XmlSimpleList extends Object implements List, Serializable
The 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(List 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, Object element)Unsupported because this list is immutable.booleanadd(Object o)Unsupported because this list is immutable.booleanaddAll(int index, Collection c)Unsupported because this list is immutable.booleanaddAll(Collection coll)Unsupported because this list is immutable.voidclear()Unsupported because this list is immutable.booleancontains(Object o)True if the list is contains an object equal to o.booleancontainsAll(Collection coll)True if the list is contains all the objects in the given collection.booleanequals(Object o)Two XmlSimpleLists are equal if all their items are equal.Objectget(int index)Returns the object at the specified position in this list.inthashCode()Combines the hash codes of all the list items.intindexOf(Object o)Returns index of the first occurance of an object equal to o.booleanisEmpty()True if the list is empty.Iteratoriterator()Returns an iterator over the elements in this list in proper sequence.intlastIndexOf(Object o)Returns index of the last occurance of an object equal to o.ListIteratorlistIterator()Returns a list iterator of the elements in this list in proper sequence.ListIteratorlistIterator(int index)Returns a list iterator of the elements in this list in proper sequence, starting at the specified position in this list.Objectremove(int index)Unsupported because this list is immutable.booleanremove(Object o)Unsupported because this list is immutable.booleanremoveAll(Collection coll)Unsupported because this list is immutable.booleanretainAll(Collection coll)Unsupported because this list is immutable.Objectset(int index, Object element)Unsupported because this list is immutable.intsize()Returns the number of elements in this list.ListsubList(int from, int to)Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.Object[]toArray()Copies the collection to an array.Object[]toArray(Object[] a)Copies the collection to an array of a specified type.StringtoString()Returns a space-separated list of the string representations of all the items in the list.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Method Detail
-
size
public int size()
Returns the number of elements in this list.- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceList
-
isEmpty
public boolean isEmpty()
True if the list is empty.- Specified by:
isEmptyin interfaceCollection- Specified by:
isEmptyin interfaceList
-
contains
public boolean contains(Object o)
True if the list is contains an object equal to o.- Specified by:
containsin interfaceCollection- Specified by:
containsin interfaceList
-
containsAll
public boolean containsAll(Collection coll)
True if the list is contains all the objects in the given collection.- Specified by:
containsAllin interfaceCollection- Specified by:
containsAllin interfaceList
-
toArray
public Object[] toArray()
Copies the collection to an array.- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList
-
toArray
public Object[] toArray(Object[] a)
Copies the collection to an array of a specified type.- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList
-
add
public boolean add(Object o)
Unsupported because this list is immutable.- Specified by:
addin interfaceCollection- Specified by:
addin interfaceList
-
addAll
public boolean addAll(Collection coll)
Unsupported because this list is immutable.- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceList
-
remove
public boolean remove(Object o)
Unsupported because this list is immutable.- Specified by:
removein interfaceCollection- Specified by:
removein interfaceList
-
removeAll
public boolean removeAll(Collection coll)
Unsupported because this list is immutable.- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceList
-
retainAll
public boolean retainAll(Collection coll)
Unsupported because this list is immutable.- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceList
-
clear
public void clear()
Unsupported because this list is immutable.- Specified by:
clearin interfaceCollection- Specified by:
clearin interfaceList
-
get
public Object get(int index)
Returns the object at the specified position in this list.
-
add
public void add(int index, Object element)Unsupported because this list is immutable.
-
remove
public Object remove(int index)
Unsupported because this list is immutable.
-
indexOf
public int indexOf(Object o)
Returns index of the first occurance of an object equal to o.
-
lastIndexOf
public int lastIndexOf(Object o)
Returns index of the last occurance of an object equal to o.- Specified by:
lastIndexOfin interfaceList
-
addAll
public boolean addAll(int index, Collection c)Unsupported because this list is immutable.
-
subList
public List subList(int from, int to)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
-
iterator
public Iterator iterator()
Returns an iterator over the elements in this list in proper sequence.
-
listIterator
public ListIterator listIterator()
Returns a list iterator of the elements in this list in proper sequence.- Specified by:
listIteratorin interfaceList
-
listIterator
public ListIterator 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 interfaceList
-
toString
public 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.)
-
equals
public boolean equals(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.)
-
-