public class SuballocatedByteVector
extends java.lang.Object
Constructor | Description |
---|---|
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.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addElement(byte value) |
Append a byte onto the vector.
|
byte |
elementAt(int i) |
Get the nth element.
|
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.
|
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.
|
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.
|
public SuballocatedByteVector()
public SuballocatedByteVector(int blocksize)
blocksize
- Size of block to allocatepublic SuballocatedByteVector(int blocksize, int increaseSize)
blocksize
- Size of block to allocatepublic int size()
public void addElement(byte value)
value
- Byte to add to the listpublic void removeAllElements()
public void setElementAt(byte value, int at)
value
- at
- Index of where to set the objectpublic byte elementAt(int i)
i
- index of value to getjava.lang.ArrayIndexOutOfBoundsException
- if the index was _clearly_
unreasonable (negative, or past the highest block).java.lang.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?public int indexOf(byte elem, int index)
elem
- object to look forindex
- Index of where to begin searchpublic int indexOf(byte elem)
elem
- object to look forCopyright ? 2014 Apache XML Project. All Rights Reserved.