org.jfree.layouting.util
Class IntList
java.lang.Object
org.jfree.layouting.util.IntList
- Cloneable, Serializable
public class IntList
extends java.lang.Object
implements Serializable, Cloneable
A Array-List for integer objects. Ints can be added to the list and will be
stored in an int-array.
Using this list for storing ints is much faster than creating
java.lang.Integer objects and storing them in an ArrayList.
This list is not synchronized and does not implement the full List interface.
In fact, this list can only be used to add new values or to clear the
complete list.
IntList(int capacity) - Creates a new IntList with the given initial capacity.
|
void | add(int value) - Adds the given int value to the list.
|
void | clear() - Clears the list.
|
Object | clone()
|
int | get(int index) - Returns the value at the given index.
|
int | peek()
|
int | pop()
|
void | push(int value)
|
void | set(int index, int value) - Adds the given int value to the list.
|
int | size() - Returns the number of elements in this list.
|
int[] | toArray() - Copys the list contents into a new array.
|
IntList
public IntList(int capacity)
Creates a new IntList with the given initial capacity. The capacity will
also be used as increment value when extending the capacity of the list.
capacity
- the initial capacity.
add
public void add(int value)
Adds the given int value to the list.
value
- the new value to be added.
clear
public void clear()
Clears the list.
clone
public Object clone()
throws CloneNotSupportedException
get
public int get(int index)
Returns the value at the given index.
- the value at the given index
push
public final void push(int value)
set
public void set(int index,
int value)
Adds the given int value to the list.
value
- the new value to be added.
size
public int size()
Returns the number of elements in this list.
- the number of elements in the list
toArray
public int[] toArray()
Copys the list contents into a new array.
- the list contents as array.