edu.tum.cs.commons.collections
Class IntList
java.lang.Object
edu.tum.cs.commons.collections.ManagedIntArray
edu.tum.cs.commons.collections.IntList
public class IntList
- extends ManagedIntArray
A really simple list for storing ints. This exists as it is both more
efficient and uses way less memory than a List of Integers.
- Version:
- $Rev: 26283 $
- Author:
- hummelb, $Author: juergens $
- Rating:
- GREEN Hash: 98A63662009CD83FB4E7243830757973
|
Method Summary |
void |
add(int value)
Adds an element to the end of the list. |
int |
get(int index)
Returns the element at the given index. |
int |
getSize()
Returns the size of the list. |
void |
set(int index,
int value)
Set the element at the given index. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IntList
public IntList()
getSize
public int getSize()
- Returns the size of the list.
get
public int get(int index)
- Returns the element at the given index. No range checking is performed,
thus you might sometimes get an
ArrayIndexOutOfBoundsException,
and sometimes just 0 returned, depending on if you reached existing
memory by chance.
set
public void set(int index,
int value)
- Set the element at the given index. No range checking is performed, thus
you might sometimes get an
ArrayIndexOutOfBoundsException, and
sometimes not for illegal indexes, depending on whether you hit memory
allocated by the exponential growth strategy by chance.
add
public void add(int value)
- Adds an element to the end of the list.
TUM CCSM Commons - 2.7