Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl.xs.util

public final Class ObjectListImpl

extends AbstractList<Object>
implements ObjectList
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable
Annotations
@SuppressWarnings:unchecked
Imports
com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList, java.lang.reflect.Array, java.util.AbstractList

Contains a list of Objects.

Field Summary

Modifier and TypeField and Description
public static final ObjectListImpl
EMPTY_LIST

An immutable empty list.

private final Object[]
private final int
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public
ObjectListImpl(Object[] array, int length)

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(Object
Object whose presence in this list is to be tested.
item
)

Overrides java.util.AbstractCollection.contains.

Implements com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList.contains, java.util.List.contains, java.util.Collection.contains.

Checks if the Object item is a member of this list.

public Object
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.

public int
public Object
item(int
index into the collection.
index
)

Implements com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList.item.

Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list.

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.

public Object[]
toArray()

Overrides java.util.AbstractCollection.toArray.

Implements java.util.List.toArray, java.util.Collection.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element).

public Object[]
toArray(Object[]
the array into which the elements of this list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
a
)

Overrides java.util.AbstractCollection.toArray.

Implements java.util.List.toArray, java.util.Collection.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.

private void
Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangesetsubList

Field Detail

EMPTY_LISTback to summary
public static final ObjectListImpl EMPTY_LIST

An immutable empty list.

fArrayback to summary
private final Object[] fArray
fLengthback to summary
private final int fLength

Constructor Detail

ObjectListImplback to summary
public ObjectListImpl(Object[] array, int length)

Method Detail

containsback to summary
public boolean contains(Object item)

Overrides java.util.AbstractCollection.contains.

Implements com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList.contains, java.util.List.contains, java.util.Collection.contains.

Doc from com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList.contains.

Checks if the Object item is a member of this list.

Parameters
item:Object

Object whose presence in this list is to be tested.

Returns:boolean

True if this list contains the Object item.

getback to summary
public Object get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.List.get.

Returns the element at the specified position in this list.

Parameters
index:int

index of the element to return

Returns:Object

the element at the specified position in this list

getLengthback to summary
public int getLength()

Implements com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList.getLength.

Doc from com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList.getLength.

The number of Objects in the list. The range of valid child object indices is 0 to length-1 inclusive.

itemback to summary
public Object item(int index)

Implements com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList.item.

Doc from com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList.item.

Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list. The index starts at 0.

Parameters
index:int

index into the collection.

Returns:Object

The Object at the indexth position in the ObjectList, or null if the index specified is not valid - greater than or equal to the number of items in the list or less than zero.

sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

toArrayback to summary
public Object[] toArray()

Overrides java.util.AbstractCollection.toArray.

Implements java.util.List.toArray, java.util.Collection.toArray.

Doc from java.util.List.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element).

The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array even if this list is backed by an array). The caller is thus free to modify the returned array.

This method acts as bridge between array-based and collection-based APIs.

Returns:Object[]

an array containing all of the elements in this list in proper sequence

toArrayback to summary
public Object[] toArray(Object[] a)

Overrides java.util.AbstractCollection.toArray.

Implements java.util.List.toArray, java.util.Collection.toArray.

Doc from java.util.List.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list.

If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the list is set to null. (This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.)

Like the toArray() method, this method acts as bridge between array-based and collection-based APIs. Further, this method allows precise control over the runtime type of the output array, and may, under certain circumstances, be used to save allocation costs.

Suppose x is a list known to contain only strings. The following code can be used to dump the list into a newly allocated array of String:

String[] y = x.toArray(new String[0]);
Note that toArray(new Object[0]) is identical in function to toArray().
Parameters
a:Object[]

the array into which the elements of this list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.

Returns:Object[]

an array containing the elements of this list

toArray0back to summary
private void toArray0(Object[] a)