|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.mat.collect.ArrayIntBig
public final class ArrayIntBig
This class simplifies the handling of growing int[] in a very fast and memory
efficient manner so that no slow collections must be used. However this class
is only fast on big int[] and not on small ones where you collect just a
couple of ints. The internal data is never copied during the process of
growing. Only with toArray() the data is copied to the result int[].
| Constructor Summary | |
|---|---|
ArrayIntBig()
Create an IntArray. |
|
| Method Summary | |
|---|---|
void |
add(int element)
Add int to IntArray. |
void |
addAll(int[] elements)
Add int[] to IntArray. |
long |
consumption()
Get memory consumption of IntArray. |
int |
get(int index)
Get int at index from IntArray. |
boolean |
isEmpty()
Returns true if this list contains no elements. |
int |
length()
Get length of IntArray. |
int[] |
toArray()
Convert IntArray to int[]. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayIntBig()
IntArray. Memory consumption is equal to creating
a new ArrayList.
| Method Detail |
|---|
public final void add(int element)
IntArray.
element - int which should be addedpublic final void addAll(int[] elements)
IntArray.
elements - int[] which should be added
public final int get(int index)
throws IndexOutOfBoundsException
IntArray.
index - index of int which should be returned
IndexOutOfBoundsExceptionpublic final int length()
IntArray.
IntArraypublic boolean isEmpty()
public final long consumption()
IntArray.
IntArraypublic final int[] toArray()
IntArray to int[]. This operation is the only one
where the internal data is copied. It is directly copied to the int[]
which is returned, so don't call this method more than once when done.
IntArray
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||