org.tentackle.util
Class LongArray
java.lang.Object
org.tentackle.util.LongArray
public class LongArray
- extends Object
Fast array for long primitives.
We cannot use generics because they don't work with primitives (at least not without auto-boxing).
Currently, we need that class only as a fast replacement for ArrayList.
- Author:
- harald
|
Constructor Summary |
LongArray()
Creates an empty array of longs with a default initial size. |
LongArray(int size)
Creates an empty array of longs. |
|
Method Summary |
void |
add(long value)
Adds a long value to the array |
long[] |
values()
Gets the array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LongArray
public LongArray(int size)
- Creates an empty array of longs.
- Parameters:
size - the initial size
LongArray
public LongArray()
- Creates an empty array of longs with a default initial size.
add
public void add(long value)
- Adds a long value to the array
- Parameters:
value - the long value
values
public long[] values()
- Gets the array.
- Returns:
- the array, never null.
Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de