|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.util.DynamicIntegerArray
public class DynamicIntegerArray
A limited implementation of a variable-length array of integers.
Because the get() method of this object returns a primitive integer
type, the user must specify a value that should be returned in the
even no value is contained at the specified index when it is called.
This value is permanently set at instantiation.
This class is VERY inefficient when used to store only a few values
at high indices. This object will allocate an array with containers
at values from 0 to the highest set index.
This class is a supporting class for the Echo framework. It is not
intended for use by applications.
Constructor Summary | |
---|---|
DynamicIntegerArray()
Creates a new DynamicIntegerArray with a "null value" of 0. |
|
DynamicIntegerArray(int nullValue)
Creates a new DynamicIntegerArray with the specified "null value". |
Method Summary | |
---|---|
boolean |
contains(int index)
Returns true if the array contains a value at the specified index. |
int |
get(int index)
Returns the value in the array at the specified index. |
void |
set(int index,
int value)
Sets the value at the specified index to the given value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DynamicIntegerArray()
public DynamicIntegerArray(int nullValue)
nullValue
- The value that is used to indicate null values.Method Detail |
---|
public boolean contains(int index)
index
- The array index to analyze.
public int get(int index)
index
- The index of the value to be returned.
public void set(int index, int value)
index
- The index in the array to be modified.value
- The new value to be placed at the specified index.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |