Package org.locationtech.jts.util
Class IntArrayList
java.lang.Object
org.locationtech.jts.util.IntArrayList
An extendable array of primitive
int
values.- Author:
- Martin Davis
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty list.IntArrayList
(int initialCapacity) Constructs an empty list with the specified initial capacity -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int value) Adds a value to the end of this list.void
addAll
(int[] values) Adds all values in an array to the end of this list.void
ensureCapacity
(int capacity) Increases the capacity of this list instance, if necessary, to ensure that it can hold at least the number of elements specified by the capacity argument.int
size()
Returns the number of values in this list.int[]
toArray()
Returns a int array containing a copy of the values in this list.
-
Constructor Details
-
IntArrayList
public IntArrayList()Constructs an empty list. -
IntArrayList
public IntArrayList(int initialCapacity) Constructs an empty list with the specified initial capacity- Parameters:
initialCapacity
- the initial capacity of the list
-
-
Method Details
-
size
public int size()Returns the number of values in this list.- Returns:
- the number of values in the list
-
ensureCapacity
public void ensureCapacity(int capacity) Increases the capacity of this list instance, if necessary, to ensure that it can hold at least the number of elements specified by the capacity argument.- Parameters:
capacity
- the desired capacity
-
add
public void add(int value) Adds a value to the end of this list.- Parameters:
value
- the value to add
-
addAll
public void addAll(int[] values) Adds all values in an array to the end of this list.- Parameters:
values
- an array of values
-
toArray
public int[] toArray()Returns a int array containing a copy of the values in this list.- Returns:
- an array containing the values in this list
-