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