org.jfree.report.util
public class: IntList [javadoc |
source]
java.lang.Object
org.jfree.report.util.IntList
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.
| Method from org.jfree.report.util.IntList Detail: |
public void add(int value) {
ensureCapacity(size);
data[size] = value;
size += 1;
}
Adds the given int value to the list. |
public void clear() {
size = 0;
}
|
public int get(int index) {
if (index >= size || index < 0)
{
throw new IndexOutOfBoundsException(String.valueOf(index));
}
return data[index];
}
Returns the value at the given index. |
public int size() {
return size;
}
Returns the number of elements in this list. |
public int[] toArray() {
if (size == 0)
{
return IntList.EMPTY_ARRAY;
}
final int[] retval = new int[size];
System.arraycopy(data, 0, retval, 0, size);
return retval;
}
Copys the list contents into a new array. |