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

public final Class LSInputListImpl

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

Contains a list of LSInputs.
Author
Michael Glavassevich, IBM

Field Summary

Modifier and TypeField and Description
public static final LSInputListImpl
EMPTY_LIST

An immutable empty list.

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

Constructor Summary

AccessConstructor and Description
public
LSInputListImpl(LSInput[]
the data array
array
,
int
the number of elements
length
)

Construct an LSInputList implementation

Method Summary

Modifier and TypeMethod and Description
public LSInput
get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.

public int
getLength()

Implements com.sun.org.apache.xerces.internal.xs.LSInputList.getLength.

The number of LSInputs in the list.

public LSInput

Returns:

The LSInput at the indexth position in the LSInputList, or null if the index specified is not valid.
item
(int
index into the collection.
index
)

Implements com.sun.org.apache.xerces.internal.xs.LSInputList.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[] 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 LSInputListImpl EMPTY_LIST

An immutable empty list.

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

Constructor Detail

LSInputListImplback to summary
public LSInputListImpl(LSInput[] array, int length)

Construct an LSInputList implementation

Parameters
array:LSInput[]

the data array

length:int

the number of elements

Method Detail

getback to summary
public LSInput 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.

getLengthback to summary
public int getLength()

Implements com.sun.org.apache.xerces.internal.xs.LSInputList.getLength.

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

itemback to summary
public LSInput item(int index)

Implements com.sun.org.apache.xerces.internal.xs.LSInputList.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:LSInput

The LSInput at the indexth position in the LSInputList, or null if the index specified is not valid.

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.

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.

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().
toArray0back to summary
private void toArray0(Object[] a)