XmlSimpleList Class
- public class XmlSimpleList
extends Object
implements List
, Serializable
The immutable List
returned 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.
-
Hierarchy
-
Object
XmlSimpleList
-
All Implemented Interfaces
-
Collection
, List
, Serializable
-
XmlSimpleList(
List list)
- Constructs an immutable XmlSimpleList that wraps (does not copy)
the given
List .
|
public boolean |
-
add (Object o)
- Unsupported because this list is immutable.
|
public void |
-
add (int index, Object element)
- Unsupported because this list is immutable.
|
public boolean |
-
addAll (Collection coll)
- Unsupported because this list is immutable.
|
public boolean |
-
addAll (int index, Collection c)
- Unsupported because this list is immutable.
|
public void |
-
clear ()
- Unsupported because this list is immutable.
|
public boolean |
-
contains (Object o)
- True if the list is contains an object equal to o.
|
public boolean |
-
containsAll (Collection coll)
- True if the list is contains all the objects in the given collection.
|
public boolean |
-
equals (Object o)
- Two XmlSimpleLists are equal if all their items are equal.
|
public Object |
-
get (int index)
- Returns the object at the specified position in this list.
|
public int |
-
hashCode ()
- Combines the hash codes of all the list items.
|
public int |
-
indexOf (Object o)
- Returns index of the first occurance of an object equal to o.
|
public boolean |
-
isEmpty ()
- True if the list is empty.
|
public Iterator |
-
iterator ()
- Returns an iterator over the elements in this list in proper sequence.
|
public int |
-
lastIndexOf (Object o)
- Returns index of the last occurance of an object equal to o.
|
public ListIterator |
-
listIterator ()
- Returns a list iterator of the elements in this list in proper sequence.
|
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.
|
public boolean |
-
remove (Object o)
- Unsupported because this list is immutable.
|
public Object |
-
remove (int index)
- Unsupported because this list is immutable.
|
public boolean |
-
removeAll (Collection coll)
- Unsupported because this list is immutable.
|
public boolean |
-
retainAll (Collection coll)
- Unsupported because this list is immutable.
|
public Object |
-
set (int index, Object element)
- Unsupported because this list is immutable.
|
public int |
-
size ()
- Returns the number of elements in this list.
|
public List |
-
subList (int from, int to)
- Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
|
public Object [] |
-
toArray ()
- Copies the collection to an array.
|
public Object [] |
-
toArray (Object [] a)
- Copies the collection to an array of a specified type.
|
public String |
-
toString ()
- Returns a space-separated list of the string representations of all
the items in the list.
|
Methods from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Methods from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
XmlSimpleList
public XmlSimpleList(List
list)
- Constructs an immutable XmlSimpleList that wraps (does not copy)
the given
List
. All non-mutating methods delegate to
the underlying List instance.
add(Object) Method
public boolean add(Object
o)
Unsupported because this list is immutable.
add(int, Object) Method
public void add(int index,
Object
element)
Unsupported because this list is immutable.
addAll(Collection) Method
public boolean addAll(Collection
coll)
Unsupported because this list is immutable.
addAll(int, Collection) Method
public boolean addAll(int index,
Collection
c)
Unsupported because this list is immutable.
clear() Method
public void clear()
Unsupported because this list is immutable.
contains(Object) Method
public boolean contains(Object
o)
True if the list is contains an object equal to o.
containsAll(Collection) Method
public boolean containsAll(Collection
coll)
True if the list is contains all the objects in the given collection.
equals(Object) Method
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.)
-
Overrides
-
Object.equals(Object)
get(int) Method
public Object
get(int index)
Returns the object at the specified position in this list.
hashCode() Method
public int hashCode()
Combines the hash codes of all the list items.
-
Overrides
-
Object.hashCode()
indexOf(Object) Method
public int indexOf(Object
o)
Returns index of the first occurance of an object equal to o.
isEmpty() Method
public boolean isEmpty()
True if the list is empty.
iterator() Method
public Iterator
iterator()
Returns an iterator over the elements in this list in proper sequence.
lastIndexOf(Object) Method
public int lastIndexOf(Object
o)
Returns index of the last occurance of an object equal to o.
listIterator() Method
public ListIterator
listIterator()
Returns a list iterator of the elements in this list in proper sequence.
listIterator(int) Method
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.
remove(Object) Method
public boolean remove(Object
o)
Unsupported because this list is immutable.
remove(int) Method
public Object
remove(int index)
Unsupported because this list is immutable.
removeAll(Collection) Method
public boolean removeAll(Collection
coll)
Unsupported because this list is immutable.
retainAll(Collection) Method
public boolean retainAll(Collection
coll)
Unsupported because this list is immutable.
set(int, Object) Method
public Object
set(int index,
Object
element)
Unsupported because this list is immutable.
size() Method
public int size()
Returns the number of elements in this list.
subList(int, int) Method
public List
subList(int from,
int to)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
toArray() Method
public Object
[] toArray()
Copies the collection to an array.
toArray(Object[]) Method
public Object
[] toArray(Object
[] a)
Copies the collection to an array of a specified type.
toString() Method
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.)
-
Overrides
-
Object.toString()