org.apache.xml.utils
public class SuballocatedByteVector extends Object
UNKNOWN: internal
Constructor Summary | |
---|---|
SuballocatedByteVector()
Default constructor. | |
SuballocatedByteVector(int blocksize)
Construct a ByteVector, using the given block size.
| |
SuballocatedByteVector(int blocksize, int increaseSize)
Construct a ByteVector, using the given block size.
|
Method Summary | |
---|---|
void | addElement(byte value)
Append a byte onto the vector.
|
byte | elementAt(int i)
Get the nth element. |
int | indexOf(byte elem, int index)
Searches for the first occurence of the given argument,
beginning the search at index, and testing for equality
using the equals method.
|
int | indexOf(byte elem)
Searches for the first occurence of the given argument,
beginning the search at index, and testing for equality
using the equals method.
|
void | removeAllElements()
Wipe it out. |
void | setElementAt(byte value, int at)
Sets the component at the specified index of this vector to be the
specified object. |
int | size()
Get the length of the list.
|
Parameters: blocksize Size of block to allocate
Parameters: blocksize Size of block to allocate
Parameters: value Byte to add to the list
Parameters: i index of value to get
Returns: value at given index. If that value wasn't previously set, the result is undefined for performance reasons. It may throw an exception (see below), may return zero, or (if setSize has previously been used) may return stale data.
Throws: ArrayIndexOutOfBoundsException if the index was _clearly_ unreasonable (negative, or past the highest block). NullPointerException if the index points to a block that could have existed (based on the highest index used) but has never had anything set into it. %REVIEW% Could add a catch to create the block in that case, or return 0. Try/Catch is _supposed_ to be nearly free when not thrown to. Do we believe that? Should we have a separate safeElementAt?
Parameters: elem object to look for index Index of where to begin search
Returns: the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.
Parameters: elem object to look for
Returns: the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.
Parameters: value at Index of where to set the object
Returns: length of the list