public class FastVector
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private int |
capacity |
private int[] |
data |
private int |
increment |
private int |
size |
| Constructor and Description |
|---|
FastVector()
Constructor.
|
FastVector(int initialCapacity)
Constructor.
|
FastVector(int initialCapacity,
int capacityIncrement)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(int element)
Add an element to the end of the array.
|
int[] |
getData()
Get access to array data
|
int |
getSize()
Get number of ints currently stored in the array;
|
private int[] data
private int capacity
private int increment
private int size
public FastVector(int initialCapacity,
int capacityIncrement)
initialCapacity - Number of ints the object can hold
without reallocating the array.capacityIncrement - Once the array has grown beyond
its capacity, how much larger the reallocated array should be.public FastVector(int initialCapacity)
initialCapacity - Number of ints the object can hold
without reallocating the array.public FastVector()
Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.