org.apache.xml.utils
public class SuballocatedIntVector extends Object
Constructor Summary | |
---|---|
SuballocatedIntVector()
Default constructor. | |
SuballocatedIntVector(int blocksize, int numblocks)
Construct a IntVector, using the given block size and number
of blocks. | |
SuballocatedIntVector(int blocksize) Construct a IntVector, using the given block size and
the default number of blocks (32).
|
Method Summary | |
---|---|
void | addElement(int value)
Append a int onto the vector.
|
int | elementAt(int i)
Get the nth element. |
int[][] | getMap()
Return the m_map double array |
int[] | getMap0()
Return the internal m_map0 array |
int | indexOf(int 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(int 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(int value, int at)
Sets the component at the specified index of this vector to be the
specified object. |
void | setSize(int sz)
Set the length of the list. |
int | size()
Get the length of the list.
|
Parameters: blocksize Size of block to allocate numblocks Number of blocks to allocate
Parameters: blocksize Size of block to allocate
Parameters: value Int 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?
Returns: the internal map of array of arrays
Returns: the m_map0 array
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 object to set at Index of where to set the object
Returns: length of the list
Returns: length of the list