Inherits java::io::Serializable.
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 |
A resizable, array of integer primitives.
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.
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.
values | an int[] value |
References com.cosylab.acs.maci.IntArray.add().
void com.cosylab.acs.maci.IntArray.add | ( | int | val | ) |
Adds val
to the end of the list, growing as needed.
val | an int value |
References com.cosylab.acs.maci.IntArray.data, and com.cosylab.acs.maci.IntArray.ensureCapacity().
Referenced by com.cosylab.acs.maci.IntArray.add(), com.cosylab.acs.maci.manager.recovery.ContainerInfoCommandComponentAdd.execute(), com.cosylab.acs.maci.manager.recovery.ComponentInfoCommandComponentAdd.execute(), com.cosylab.acs.maci.manager.recovery.ComponentCommandClientAdd.execute(), com.cosylab.acs.maci.manager.recovery.ClientInfoCommandComponentAdd.execute(), com.cosylab.acs.maci.IntArray.insert(), com.cosylab.acs.maci.IntArray.IntArray(), com.cosylab.acs.maci.manager.ManagerImpl.registerComponent(), and com.cosylab.acs.maci.manager.ComponentInfoTopologicalSortManager.run().
void com.cosylab.acs.maci.IntArray.add | ( | int[] | vals | ) |
Adds the values in the array vals
to the end of the list, in order.
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.
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
.
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.
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
value | an int value |
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.
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.
other | the object to compare against |
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.
offset | an int value |
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.
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.
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.
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.
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.
int com.cosylab.acs.maci.IntArray.remove | ( | int | value | ) |
Removes the element with value value
from the list.
value | value of the element to be removed |
References com.cosylab.acs.maci.IntArray.data, and com.cosylab.acs.maci.IntArray.removeAt().
Referenced by com.cosylab.acs.maci.manager.recovery.ContainerInfoCommandComponentRemove.execute(), com.cosylab.acs.maci.manager.recovery.ComponentInfoCommandComponentRemove.execute(), com.cosylab.acs.maci.manager.recovery.ComponentCommandClientRemove.execute(), and com.cosylab.acs.maci.manager.recovery.ClientInfoCommandComponentRemove.execute().
int com.cosylab.acs.maci.IntArray.removeAt | ( | int | offset | ) |
Removes the value at offset
from the list.
offset | an int value |
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
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.
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.
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.
offset | the first offset to replace | |
values | the source of the new values |
int com.cosylab.acs.maci.IntArray.size | ( | ) |
Returns the number of values in the list.
Referenced by com.cosylab.acs.maci.IntArray.equals(), com.cosylab.acs.maci.manager.ManagerImpl.ShutdownContainerTask.run(), com.cosylab.acs.maci.manager.ComponentInfoTopologicalSortManager.run(), and com.cosylab.acs.maci.IntArray.trimToSize().
int [] com.cosylab.acs.maci.IntArray.toArray | ( | int | offset, | |
int | len | |||
) |
Copies a slice of the list into a native array.
offset | the offset at which to start copying | |
len | the number of values to copy. |
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.
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.
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.
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().
transient int [] com.cosylab.acs.maci.IntArray.data [protected] |
Array data.
Referenced by com.cosylab.acs.maci.IntArray.add(), com.cosylab.acs.maci.IntArray.clear(), com.cosylab.acs.maci.IntArray.clone(), com.cosylab.acs.maci.IntArray.contains(), com.cosylab.acs.maci.IntArray.ensureCapacity(), com.cosylab.acs.maci.IntArray.equals(), com.cosylab.acs.maci.IntArray.get(), com.cosylab.acs.maci.IntArray.hashCode(), com.cosylab.acs.maci.IntArray.insert(), com.cosylab.acs.maci.IntArray.IntArray(), com.cosylab.acs.maci.IntArray.remove(), com.cosylab.acs.maci.IntArray.removeAt(), com.cosylab.acs.maci.IntArray.set(), com.cosylab.acs.maci.IntArray.toArray(), com.cosylab.acs.maci.IntArray.toString(), and com.cosylab.acs.maci.IntArray.trimToSize().