| java.lang.Object gov.nasa.jpf.util.DynamicIntArray
DynamicIntArray | public class DynamicIntArray (Code) | | simplistic dynamic array that differentiates from ArrayList by
- using chunks instead of exponential growth, thus efficiently dealing
with sparse arrays
- managing primitive 'int' types, i.e. not requiring box objects
the motivation for this class is memory optimization, i.e. space efficient
storage of potentially huge arrays without good a-priori size guesses
the API of this class is between a primitive array and a AbstractList. It's
not a Collection implementation because it handles primitive types, but the
API could be extended to support iterators and the like.
NOTE: like standard Collection implementations/arrays, this class is not
synchronized
|
Method Summary | |
public int | get(int index) | public void | grow(int index) Ensure that the given index is valid. | public boolean | isEmpty() | public void | set(int index, int value) | public int | size() | public int[] | toArray(int[] buf) | public String | toString() |
DEFAULT_CHUNKSIZE | final static int DEFAULT_CHUNKSIZE(Code) | | |
INIT_CHUNKS | final static int INIT_CHUNKS(Code) | | |
data | int[][] data(Code) | | our allocation sizes
|
length | int length(Code) | | the real data
|
DynamicIntArray | public DynamicIntArray()(Code) | | max set element index +1
|
DynamicIntArray | public DynamicIntArray(int chunkSize)(Code) | | |
get | public int get(int index)(Code) | | |
grow | public void grow(int index)(Code) | | Ensure that the given index is valid.
|
isEmpty | public boolean isEmpty()(Code) | | |
set | public void set(int index, int value)(Code) | | |
toArray | public int[] toArray(int[] buf)(Code) | | |
|
|