|
BRUtil - Making Java a Kinder, Gentler, Place to be. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--brutil.Array
This is an automatically-resizing array list. It starts as a single array of objects (initialized to 'initialSize' field, and upon necessity grows and adds Subarrays of size 'capacityIncrement' to simulate a seamless array list.
| Inner Class Summary | |
protected class |
Array.Subarray
Subarrays act as sub-modules for the Array. |
| Field Summary | |
protected static int |
defaultCapacityIncrement
|
protected static int |
defaultInitialCapacity
|
protected static int |
STARTSIZE
|
| Constructor Summary | |
Array()
Default Constructor, initial capacity = 10, increment = 10 |
|
Array(int initialCapacity)
Instantiates array with specified initial capacity. |
|
Array(int initialCapacity,
int capacityIncrement)
Instantiates array with specified initial capacity and capacityIncrement, uses the default value for the maximum number of SubArrays |
|
Array(int initialCapacity,
int capacityIncrement,
int maxSize)
The main constructor. |
|
| Method Summary | |
void |
clear()
Sets every element in the Array to null |
protected Array.Subarray |
createSubarray(int size)
|
protected Array.Subarray[] |
createSubarrayArray(int size)
|
java.lang.Object |
get(int index)
Gets the object at the specified index. |
protected void |
initMemory()
|
boolean |
isEmpty()
Returns true if empty |
protected int |
maxLength()
Returns the maximum length of the Array. |
brutil.behavior.FrequencyDist |
predictTime(java.lang.String method,
brutil.behavior.State currentState)
|
java.lang.Object |
set(java.lang.Object obj,
int index)
Overwrites the element at this index to be the specified object and returns the former object. |
int |
size()
Returns the size of the array from List interface. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int defaultInitialCapacity
protected static final int defaultCapacityIncrement
protected static final int STARTSIZE
| Constructor Detail |
public Array()
public Array(int initialCapacity)
public Array(int initialCapacity,
int capacityIncrement)
public Array(int initialCapacity,
int capacityIncrement,
int maxSize)
| Method Detail |
public brutil.behavior.FrequencyDist predictTime(java.lang.String method,
brutil.behavior.State currentState)
public java.lang.Object set(java.lang.Object obj,
int index)
public java.lang.Object get(int index)
public int size()
size in interface Collectionpublic boolean isEmpty()
isEmpty in interface Collectionprotected int maxLength()
public void clear()
clear in interface Collectionprotected void initMemory()
protected Array.Subarray createSubarray(int size)
protected Array.Subarray[] createSubarrayArray(int size)
|
BRUtil - Making Java a Kinder, Gentler, Place to be. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||