|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.common.ByteVector
public class ByteVector
A vector of bytes.
Constructor Summary | |
---|---|
ByteVector()
No-argument constructor. |
|
ByteVector(int capacity)
Constructor. |
Method Summary | |
---|---|
void |
add(byte value)
Adds one element to the vector. |
int |
alloc(int size)
Allocates or uses a specified number of elements (bytes). |
int |
capacity()
Returns the current capacity of the vector. |
byte |
get(int index)
Retrieve a value from a specific index in the vector. |
int |
length()
Returns the number of items in the vector. |
void |
set(int index,
byte val)
Place an item in the vector at a specific index. |
void |
trimToSize()
Sets the capacity of this vector equal to its size, to that there is no unused capacity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ByteVector()
public ByteVector(int capacity)
capacity
- The initial capacity, in bytes, of the new vector.Method Detail |
---|
public int length()
public int capacity()
public void add(byte value)
value
- The byte value to be added to the vector.public void set(int index, byte val)
index
- The 0-based index into the vector.val
- The byte value to be placed in the vector.public byte get(int index)
index
- The 0-based index whose value should be returned.
index
.public int alloc(int size)
size
- The number of elements (bytes) to be allocated.
public void trimToSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |