java.lang.Object | +--com.sun.kjava.IntVector
A simple expandable vector of integers, similar to java.util.Vector
.
Constructor Summary | |
IntVector()
Create a new IntVector, and make it small to start. |
|
IntVector(int initSize)
Create a new IntVector. |
Method Summary | |
void |
append(int i)
Append an integer to the end, expanding the vector if necessary. |
int |
capacity()
What is the total capacity of this IntVector? |
void |
ensureCapacity(int newCap)
Ensure there's room for some number of entries by any means necessary. |
void |
removeAllElements()
Mark the vector as containing no integers. |
int |
size()
What is the size of this IntVector? |
int |
valueAt(int i)
What is the value at a given index? N.B. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public IntVector()
public IntVector(int initSize)
initSize
- the number of initial elements to allocateMethod Detail |
public int valueAt(int i)
i
- the index of the entrypublic int size()
public void append(int i)
i
- the value of the new datumpublic void removeAllElements()
public int capacity()
size()
public void ensureCapacity(int newCap)
newCap
- the desired new capacity