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

public final Class ShortListImpl

extends AbstractList<Short>
implements ShortList
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xerces.internal.xs.ShortList, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable
Imports
com.sun.org.apache.xerces.internal.xs.ShortList, .XSException, java.util.AbstractList

Containts a list of Object's.
Author
Sandy Gao, IBM

Field Summary

Modifier and TypeField and Description
public static final ShortListImpl
EMPTY_LIST

An immutable empty list.

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

Constructor Summary

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

Construct an XSObjectList implementation

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if this list contains the unsigned short item.
contains
(short
unsigned short whose presence in this list is to be tested.
item
)

Implements com.sun.org.apache.xerces.internal.xs.ShortList.contains.

Checks if the unsigned short item is a member of this list.

public boolean
equals(Object
the object to be compared for equality with this list
obj
)

Overrides java.util.AbstractList.equals.

Implements java.util.List.equals, java.util.Collection.equals.

Compares the specified object with this list for equality.

public Short
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
getLength()

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

The number of Objects in the list.

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

Implements com.sun.org.apache.xerces.internal.xs.ShortList.item.

Returns the indexth item in the collection.

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.

Inherited from java.util.AbstractList:
addaddaddAllclearhashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangesetsubList

Field Detail

EMPTY_LISTback to summary
public static final ShortListImpl EMPTY_LIST

An immutable empty list.

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

Constructor Detail

ShortListImplback to summary
public ShortListImpl(short[] array, int length)

Construct an XSObjectList implementation

Parameters
array:short[]

the data array

length:int

the number of elements

Method Detail

containsback to summary
public boolean contains(short item)

Implements com.sun.org.apache.xerces.internal.xs.ShortList.contains.

Checks if the unsigned short item is a member of this list.

Parameters
item:short

unsigned short whose presence in this list is to be tested.

Returns:boolean

True if this list contains the unsigned short item.

equalsback to summary
public boolean equals(Object obj)

Overrides java.util.AbstractList.equals.

Implements java.util.List.equals, java.util.Collection.equals.

Doc from java.util.List.equals.

Compares the specified object with this list for equality. Returns true if and only if the specified object is also a list, both lists have the same size, and all corresponding pairs of elements in the two lists are equal. (Two elements e1 and e2 are equal if Objects.equals(e1, e2).) In other words, two lists are defined to be equal if they contain the same elements in the same order. This definition ensures that the equals method works properly across different implementations of the List interface.

Parameters
obj:Object

the object to be compared for equality with this list

Returns:boolean

true if the specified object is equal to this list

getback to summary
public Short 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:Short

the element at the specified position in this list

getLengthback to summary
public int getLength()

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

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

itemback to summary
public short item(int index) throws XSException

Implements com.sun.org.apache.xerces.internal.xs.ShortList.item.

Doc from com.sun.org.apache.xerces.internal.xs.ShortList.item.

Returns the indexth item in the collection. The index starts at 0.

Parameters
index:int

index into the collection.

Returns:short

The unsigned short at the indexth position in the ShortList.

Exceptions
XSException:
INDEX_SIZE_ERR: if index is greater than or equal to the number of objects in the list.
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