org.eigenbase.util
Class IntList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Integer>
org.eigenbase.util.IntList
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<Integer>, Collection<Integer>, List<Integer>, RandomAccess
public class IntList
- extends ArrayList<Integer>
Extension to ArrayList
to help build an array of int
values.
- Version:
- $Id: //open/dev/farrago/src/org/eigenbase/util/IntList.java#8 $
- Author:
- jhyde
- See Also:
- Serialized Form
Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
IntList
public IntList()
toIntArray
public int[] toIntArray()
toArray
public static int[] toArray(List<Integer> integers)
- Converts a list of
Integer
objects to an array of primitive
int
s.
- Parameters:
integers
- List of Integer objects
- Returns:
- Array of primitive
int
s
asList
public static List<Integer> asList(int[] args)
- Returns a list backed by an array of primitive
int
values.
The behavior is analogous to Arrays.asList(Object[])
. Changes
to the list are reflected in the array. The list cannot be extended.
- Parameters:
args
- Array of primitive int
values
- Returns:
- List backed by array