org.openmobileis.common.util.collection.IntArray Class Reference

List of all members.

Detailed Description

Title: OpenMobileIS project source
Description: Use to store an Array of int.

Author:
Philippe Delrieu
Since:
JDK 1.1
Version:
1.0.

Definition at line 40 of file IntArray.java.

Public Member Functions

 IntArray (int initialCapacity)
 Constructs an empty list with the specified initial capacity.
 IntArray ()
 Constructs an empty list.
void clear ()
void ensureCapacity (int minCapacity)
 Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
int size ()
 Returns the number of elements in this list.
boolean isEmpty ()
 Tests if this list has no elements.
boolean contains (int o)
 return true if the array contains the specified int false otherwise.
int[] toArray ()
 Returns an array containing all of the elements in this list in the correct order.
int get (int index)
 Returns the element at the specified position in this list.
boolean add (int o)
 Appends the specified element to the end of this list.
boolean add (IntArray array)
 Appends the specified LongArray to the end of this list.
boolean replace (int index, int o)
 replace at the specified index the element.
boolean add (int[] array)
 Appends the specified LongArray to the end of this list.
boolean add (int index, int o)
 Appends the specified element to the end of this list.
long remove (int index)
 Removes the element at the specified position in this list.

Protected Member Functions

int[] getArrayElements ()
void setArrayElements (int[] array)

Static Protected Attributes

static final long serialVersionUID = 5521257935120563452L


Constructor & Destructor Documentation

org.openmobileis.common.util.collection.IntArray.IntArray ( int  initialCapacity  ) 

Constructs an empty list with the specified initial capacity.

Parameters:
initialCapacity the initial capacity of the list.
Exceptions:
IllegalArgumentException if the specified initial capacity is negative

Definition at line 61 of file IntArray.java.


Member Function Documentation

void org.openmobileis.common.util.collection.IntArray.ensureCapacity ( int  minCapacity  ) 

Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.

Parameters:
minCapacity the desired minimum capacity.

Definition at line 97 of file IntArray.java.

References org.openmobileis.common.util.collection.IntArray.size().

Referenced by org.openmobileis.common.util.collection.IntArray.add().

int org.openmobileis.common.util.collection.IntArray.size (  ) 

Returns the number of elements in this list.

Returns:
the number of elements in this list.

Definition at line 114 of file IntArray.java.

Referenced by org.openmobileis.common.util.collection.IntArray.add(), org.openmobileis.common.util.collection.IntArray.clear(), org.openmobileis.common.util.collection.IntArray.contains(), org.openmobileis.common.util.collection.IntArray.ensureCapacity(), org.openmobileis.common.util.collection.IntArray.isEmpty(), org.openmobileis.common.util.collection.IntArray.remove(), org.openmobileis.common.util.collection.IntArray.replace(), and org.openmobileis.common.util.collection.IntArray.toArray().

boolean org.openmobileis.common.util.collection.IntArray.isEmpty (  ) 

Tests if this list has no elements.

Returns:
true if this list has no elements; false otherwise.

Definition at line 124 of file IntArray.java.

References org.openmobileis.common.util.collection.IntArray.size().

boolean org.openmobileis.common.util.collection.IntArray.contains ( int  o  ) 

return true if the array contains the specified int false otherwise.

Parameters:
int o : the int to be tested.
Returns:
true if the specified int is inside the array.

Definition at line 134 of file IntArray.java.

References org.openmobileis.common.util.collection.IntArray.size().

int [] org.openmobileis.common.util.collection.IntArray.toArray (  ) 

Returns an array containing all of the elements in this list in the correct order.

Returns:
an array containing all of the elements in this list in the correct order.

Definition at line 151 of file IntArray.java.

References org.openmobileis.common.util.collection.IntArray.size().

int org.openmobileis.common.util.collection.IntArray.get ( int  index  ) 

Returns the element at the specified position in this list.

Parameters:
index index of element to return.
Returns:
the element at the specified position in this list.
Exceptions:
IndexOutOfBoundsException if index is out of range (index < 0 || index >= size()).

Definition at line 168 of file IntArray.java.

boolean org.openmobileis.common.util.collection.IntArray.add ( int  o  ) 

Appends the specified element to the end of this list.

Parameters:
o element to be appended to this list.
Returns:
true (as per the general contract of Collection.add).

Definition at line 181 of file IntArray.java.

References org.openmobileis.common.util.collection.IntArray.ensureCapacity(), and org.openmobileis.common.util.collection.IntArray.size().

boolean org.openmobileis.common.util.collection.IntArray.add ( IntArray  array  ) 

Appends the specified LongArray to the end of this list.

Parameters:
array long to add.
Returns:
true (as per the general contract of Collection.add).

Definition at line 193 of file IntArray.java.

References org.openmobileis.common.util.collection.IntArray.ensureCapacity(), org.openmobileis.common.util.collection.IntArray.getArrayElements(), and org.openmobileis.common.util.collection.IntArray.size().

boolean org.openmobileis.common.util.collection.IntArray.replace ( int  index,
int  o 
)

replace at the specified index the element.

if there is no element at index add the new one at the end of the array.

Parameters:
index index in the array where element is replaced.
o element to be replaced to this ArrayList.
Returns:
true.

Definition at line 209 of file IntArray.java.

References org.openmobileis.common.util.collection.IntArray.size().

boolean org.openmobileis.common.util.collection.IntArray.add ( int[]  array  ) 

Appends the specified LongArray to the end of this list.

Parameters:
array long to add.
Returns:
true (as per the general contract of Collection.add).

Definition at line 223 of file IntArray.java.

References org.openmobileis.common.util.collection.IntArray.ensureCapacity(), and org.openmobileis.common.util.collection.IntArray.size().

boolean org.openmobileis.common.util.collection.IntArray.add ( int  index,
int  o 
)

Appends the specified element to the end of this list.

Parameters:
o element to be appended to this list.
Returns:
true (as per the general contract of Collection.add).

Definition at line 237 of file IntArray.java.

References org.openmobileis.common.util.collection.IntArray.ensureCapacity(), and org.openmobileis.common.util.collection.IntArray.size().

long org.openmobileis.common.util.collection.IntArray.remove ( int  index  ) 

Removes the element at the specified position in this list.

Shifts any subsequent elements to the left (subtracts one from their indices).

Parameters:
index the index of the element to removed.
Returns:
the element that was removed from the list.
Exceptions:
IndexOutOfBoundsException if index out of range (index < 0 || index >= size()).

Definition at line 257 of file IntArray.java.

References org.openmobileis.common.util.collection.IntArray.size().


The documentation for this class was generated from the following file:
Generated on Tue May 22 23:01:16 2007 for OpenMobileIS by  doxygen 1.5.1-p1