|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jibx.runtime.impl.GrowableIntArray
public class GrowableIntArray
Growable int
array with type specific access methods. This
implementation is unsynchronized in order to provide the best possible
performance for typical usage scenarios, so explicit synchronization must
be implemented by a wrapper class or directly by the application in cases
where instances are modified in a multithreaded environment.
Field Summary | |
---|---|
static int |
DEFAULT_SIZE
Default initial array size. |
Constructor Summary | |
---|---|
GrowableIntArray()
Default constructor. |
|
GrowableIntArray(GrowableIntArray base)
Copy (clone) constructor. |
|
GrowableIntArray(int size)
Constructor with initial size specified. |
|
GrowableIntArray(int size,
int growth)
Constructor with full specification. |
Method Summary | |
---|---|
void |
add(int value)
Add a value at the end of the array. |
void |
addAll(int[] values)
Add an array of values at the end of the array. |
void |
clear()
Set the array to the empty state. |
java.lang.Object |
clone()
Duplicates the object with the generic call. |
void |
ensureCapacity(int min)
Ensure that the array has the capacity for at least the specified number of values. |
int |
get(int index)
Get a value from the array. |
boolean |
isEmpty()
Check if array is empty. |
void |
remove(int count)
Remove some number of values from the end of the array. |
void |
set(int index,
int value)
Overwrite an existing value in the array. |
int |
size()
Get the number of values currently present in the array. |
int[] |
toArray()
Constructs and returns a simple array containing the same data as held in this array. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_SIZE
Constructor Detail |
---|
public GrowableIntArray(int size, int growth)
size
- number of int
values initially allowed in
arraygrowth
- maximum size increment for growing arraypublic GrowableIntArray(int size)
size
- number of int
values initially allowed in
arraypublic GrowableIntArray()
public GrowableIntArray(GrowableIntArray base)
base
- instance being copiedMethod Detail |
---|
public final void ensureCapacity(int min)
min
- minimum capacity to be guaranteedpublic void set(int index, int value)
index
- position of value to be overwrittenvalue
- value to be addedpublic void add(int value)
value
- value to be addedpublic void addAll(int[] values)
values
- values to be addedpublic void remove(int count)
count
- number of values to be removed
java.lang.ArrayIndexOutOfBoundsException
- on attempt to remove more than
the count presentpublic int get(int index)
index
- index of value to be returned
java.lang.ArrayIndexOutOfBoundsException
- on attempt to access outside
valid rangepublic int[] toArray()
public java.lang.Object clone()
clone
in class java.lang.Object
public int size()
public boolean isEmpty()
true
if array empty, false
if notpublic void clear()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |