Public Member Functions | Protected Attributes

com.cosylab.acs.maci.IntArray Class Reference

Inherits java::io::Serializable.

List of all members.

Public Member Functions

 IntArray ()
 IntArray (int capacity)
 IntArray (int[] values)
void ensureCapacity (int capacity)
int size ()
boolean isEmpty ()
void trimToSize ()
void add (int val)
void add (int[] vals)
void add (int[] vals, int offset, int length)
void insert (int offset, int value)
void insert (int offset, int[] values)
void insert (int offset, int[] values, int valOffset, int len)
int get (int offset)
void set (int offset, int val)
void set (int offset, int[] values)
void set (int offset, int[] values, int valOffset, int length)
void clear ()
void clear (int capacity)
int removeAt (int offset)
int remove (int value)
void removeAt (int offset, int length)
Object clone ()
int[] toArray ()
int[] toArray (int offset, int len)
void toArray (int[] dest, int offset, int len)
boolean equals (Object other)
int hashCode ()
boolean contains (int value)
String toString ()

Protected Attributes

transient int[] data

Detailed Description

A resizable, array of integer primitives.

Author:
Matej Sekoranja (matej.sekoranja@cosylab.com)
Version:
@VERSION@

Constructor & Destructor Documentation

com.cosylab.acs.maci.IntArray.IntArray (  ) 

Constrcuts a new IntArray instance with the default capacity.

com.cosylab.acs.maci.IntArray.IntArray ( int  capacity  ) 

Constrcuts a new IntArray instance with the specified capacity.

Parameters:
capacity an int value

References com.cosylab.acs.maci.IntArray.data.

com.cosylab.acs.maci.IntArray.IntArray ( int[]  values  ) 

Constrcuts a new IntArray instance whose capacity is the greater of the length of values and DEFAULT_CAPACITY and whose initial contents are the specified values.

Parameters:
values an int[] value

References com.cosylab.acs.maci.IntArray.add().


Member Function Documentation

void com.cosylab.acs.maci.IntArray.add ( int  val  ) 
void com.cosylab.acs.maci.IntArray.add ( int[]  vals  ) 

Adds the values in the array vals to the end of the list, in order.

Parameters:
vals an int[] value

References com.cosylab.acs.maci.IntArray.add().

void com.cosylab.acs.maci.IntArray.add ( int[]  vals,
int  offset,
int  length 
)

Adds a subset of the values in the array vals to the end of the list, in order.

Parameters:
vals an int[] value
offset the offset at which to start copying
length the number of values to copy.

References com.cosylab.acs.maci.IntArray.data, and com.cosylab.acs.maci.IntArray.ensureCapacity().

void com.cosylab.acs.maci.IntArray.clear ( int  capacity  ) 

Flushes the internal state of the list, setting the capacity of the empty list to capacity.

Parameters:
capacity an int value

References com.cosylab.acs.maci.IntArray.data.

void com.cosylab.acs.maci.IntArray.clear (  ) 

Flushes the internal state of the list, resetting the capacity to the default.

Object com.cosylab.acs.maci.IntArray.clone (  ) 

Returns a clone of this list. Since this is a primitive collection, this will be a deep clone.

Returns:
a deep clone of the list.

References com.cosylab.acs.maci.IntArray.clone(), and com.cosylab.acs.maci.IntArray.data.

Referenced by com.cosylab.acs.maci.IntArray.clone().

boolean com.cosylab.acs.maci.IntArray.contains ( int  value  ) 

Searches the list for value

Parameters:
value an int value
Returns:
true if value is in the list.

References com.cosylab.acs.maci.IntArray.data.

Referenced by com.cosylab.acs.maci.manager.ManagerImpl.makeComponentImmortal(), and com.cosylab.acs.maci.manager.ManagerImpl.registerComponent().

void com.cosylab.acs.maci.IntArray.ensureCapacity ( int  capacity  ) 

Grow the internal array as needed to accomodate the specified number of elements. The size of the array doubles on each resize unless capacity requires more than twice the current capacity.

Parameters:
capacity an int value

References com.cosylab.acs.maci.IntArray.data.

Referenced by com.cosylab.acs.maci.IntArray.add(), and com.cosylab.acs.maci.IntArray.insert().

boolean com.cosylab.acs.maci.IntArray.equals ( Object  other  ) 

Compares this list to another list, value by value.

Parameters:
other the object to compare against
Returns:
true if other is a TIntArrayList and has exactly the same values.

References com.cosylab.acs.maci.IntArray.data, and com.cosylab.acs.maci.IntArray.size().

int com.cosylab.acs.maci.IntArray.get ( int  offset  ) 

Returns the value at the specified offset.

Parameters:
offset an int value
Returns:
an int value

References com.cosylab.acs.maci.IntArray.data.

int com.cosylab.acs.maci.IntArray.hashCode (  ) 

Returns the hash code value for this list.

This implementation uses exactly the code that is used to define the list hash function in the documentation for the List.hashCode method.

Returns:
the hash code value for this list.

References com.cosylab.acs.maci.IntArray.data.

void com.cosylab.acs.maci.IntArray.insert ( int  offset,
int  value 
)

Inserts value into the list at offset. All values including and to the right of offset are shifted to the right.

Parameters:
offset an int value
value an int value

References com.cosylab.acs.maci.IntArray.add(), com.cosylab.acs.maci.IntArray.data, and com.cosylab.acs.maci.IntArray.ensureCapacity().

Referenced by com.cosylab.acs.maci.IntArray.insert().

void com.cosylab.acs.maci.IntArray.insert ( int  offset,
int[]  values 
)

Inserts the array of values into the list at offset. All values including and to the right of offset are shifted to the right.

Parameters:
offset an int value
values an int[] value

References com.cosylab.acs.maci.IntArray.insert().

void com.cosylab.acs.maci.IntArray.insert ( int  offset,
int[]  values,
int  valOffset,
int  len 
)

Inserts a slice of the array of values into the list at offset. All values including and to the right of offset are shifted to the right.

Parameters:
offset an int value
values an int[] value
valOffset the offset in the values array at which to start copying.
len the number of values to copy from the values array

References com.cosylab.acs.maci.IntArray.add(), com.cosylab.acs.maci.IntArray.data, and com.cosylab.acs.maci.IntArray.ensureCapacity().

boolean com.cosylab.acs.maci.IntArray.isEmpty (  ) 

Tests whether this list contains any values.

Returns:
true if the list is empty.
int com.cosylab.acs.maci.IntArray.remove ( int  value  ) 
int com.cosylab.acs.maci.IntArray.removeAt ( int  offset  ) 

Removes the value at offset from the list.

Parameters:
offset an int value
Returns:
the value previously stored at offset.

Referenced by com.cosylab.acs.maci.IntArray.remove().

void com.cosylab.acs.maci.IntArray.removeAt ( int  offset,
int  length 
)

Removes length values from the list, starting at offset

Parameters:
offset an int value
length an int value

References com.cosylab.acs.maci.IntArray.data.

void com.cosylab.acs.maci.IntArray.set ( int  offset,
int[]  values,
int  valOffset,
int  length 
)

Replace the values in the list starting at offset with length values from the values array, starting at valOffset.

Parameters:
offset the first offset to replace
values the source of the new values
valOffset the first value to copy from the values array
length the number of values to copy

References com.cosylab.acs.maci.IntArray.data.

void com.cosylab.acs.maci.IntArray.set ( int  offset,
int  val 
)

Sets the value at the specified offset.

Parameters:
offset an int value
val an int value

References com.cosylab.acs.maci.IntArray.data.

void com.cosylab.acs.maci.IntArray.set ( int  offset,
int[]  values 
)

Replace the values in the list starting at offset with the contents of the values array.

Parameters:
offset the first offset to replace
values the source of the new values
int com.cosylab.acs.maci.IntArray.size (  ) 
int [] com.cosylab.acs.maci.IntArray.toArray ( int  offset,
int  len 
)

Copies a slice of the list into a native array.

Parameters:
offset the offset at which to start copying
len the number of values to copy.
Returns:
an int[] value

References com.cosylab.acs.maci.IntArray.toArray().

int [] com.cosylab.acs.maci.IntArray.toArray (  ) 

Copies the contents of the list into a native array.

Returns:
an int[] value

Referenced by com.cosylab.acs.maci.manager.ComponentInfoTopologicalSortManager.run(), com.cosylab.acs.maci.IntArray.toArray(), and com.cosylab.acs.maci.IntArray.trimToSize().

void com.cosylab.acs.maci.IntArray.toArray ( int[]  dest,
int  offset,
int  len 
)

Copies a slice of the list into a native array.

Parameters:
dest the array to copy into.
offset the offset of the first value to copy
len the number of values to copy.

References com.cosylab.acs.maci.IntArray.data.

String com.cosylab.acs.maci.IntArray.toString (  ) 

Returns a String representation of the list, front to back.

Returns:
a String value

References com.cosylab.acs.maci.IntArray.data.

void com.cosylab.acs.maci.IntArray.trimToSize (  ) 

Sheds any excess capacity above and beyond the current size of the list.

References com.cosylab.acs.maci.IntArray.data, com.cosylab.acs.maci.IntArray.size(), and com.cosylab.acs.maci.IntArray.toArray().


Member Data Documentation

transient int [] com.cosylab.acs.maci.IntArray.data [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties