Top Description Fields Constructors Methods
org.apache.xerces.impl.dv.util

public Class ByteListImpl

extends AbstractList
implements ByteList
Class Inheritance
All Implemented Interfaces
org.apache.xerces.xs.datatypes.ByteList, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable
Known Direct Subclasses
org.apache.xerces.impl.dv.xs.Base64BinaryDV.XBase64, org.apache.xerces.impl.dv.xs.HexBinaryDV.XHex
Imports
java.util.AbstractList, org.apache.xerces.xs.XSException, org.apache.xerces.xs.datatypes.ByteList

Implementation of org.apache.xerces.xs.datatypes.ByteList.
Author
Ankit Pasricha, IBM
Version
$Id: ByteListImpl.java 1024038 2010-10-18 22:06:35Z sandygao $

Field Summary

Modifier and TypeField and Description
protected String
protected final byte[]
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public
ByteListImpl(byte[] data)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

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

Implements org.apache.xerces.xs.datatypes.ByteList.contains.

Checks if the byte 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
getLength()

Implements org.apache.xerces.xs.datatypes.ByteList.getLength.

The number of bytes in the list.
public byte

Returns:

The byte at the indexth position in the ByteList.
item
(int
index into the collection.
index
)

Implements org.apache.xerces.xs.datatypes.ByteList.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.
public byte[]
toByteArray()

Implements org.apache.xerces.xs.datatypes.ByteList.toByteArray.

Construct and return a byte array for bytes contained in this list.
Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangesetsubList

Field Detail

canonicalback to summary
protected String canonical
databack to summary
protected final byte[] data

Constructor Detail

ByteListImplback to summary
public ByteListImpl(byte[] data)

Method Detail

containsback to summary
public boolean contains(byte item)

Implements org.apache.xerces.xs.datatypes.ByteList.contains.

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

Parameters
item:byte

byte whose presence in this list is to be tested.

Returns:boolean

True if this list contains the byte 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 org.apache.xerces.xs.datatypes.ByteList.getLength.

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

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

Implements org.apache.xerces.xs.datatypes.ByteList.item.

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

Parameters
index:int

index into the collection.

Returns:byte

The byte at the indexth position in the ByteList.

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

toByteArrayback to summary
public byte[] toByteArray()

Implements org.apache.xerces.xs.datatypes.ByteList.toByteArray.

Doc from org.apache.xerces.xs.datatypes.ByteList.toByteArray.

Construct and return a byte array for bytes contained in this list.