public class IntArray extends Object
| Constructor and Description |
|---|
IntArray()
Create an int array with the default initial capacity.
|
IntArray(int capacity)
Create an int array with specified initial capacity.
|
IntArray(int[] data)
Create an int array with the given values and size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int value)
Append a value.
|
void |
ensureCapacity(int minCapacity)
Ensure the the underlying array is large enough for the given number of
entries.
|
boolean |
equals(Object obj) |
int |
get(int index)
Get the value at the given index.
|
int |
hashCode() |
void |
remove(int index)
Remove the value at the given index.
|
void |
removeRange(int fromIndex,
int toIndex)
Remove a number of elements.
|
int |
size()
Get the size of the list.
|
void |
toArray(int[] array)
Convert this list to an array.
|
String |
toString() |
public IntArray()
public IntArray(int capacity)
capacity - the initial capacitypublic IntArray(int[] data)
data - the int arraypublic void add(int value)
value - the value to appendpublic int get(int index)
index - the indexpublic void remove(int index)
index - the indexpublic void ensureCapacity(int minCapacity)
minCapacity - the minimum capacitypublic int size()
public void toArray(int[] array)
array - the target arraypublic void removeRange(int fromIndex,
int toIndex)
fromIndex - the index of the first item to removetoIndex - upper bound (exclusive)Copyright © 2012 JBoss by Red Hat. All Rights Reserved.