|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuka.util.EnlargingBooleanArray
A simple wrapper class for a regular Java array. In addition to
the features of built-in Java arrays, instances of this class can
be enlarged either automatically by setting a value to
a position that exceeds the current size() of this array, or
manually be explicitely setting the size.
This class is more convenient than a ArrayList, if direct manipulation of the array size is
required. In addition there are customized versions of this class
for all Java basic types.
| Field Summary | |
(package private) boolean[] |
array
|
boolean |
DEFAULT
|
(package private) int |
length
|
static int |
MIN_SIZE
|
| Constructor Summary | |
EnlargingBooleanArray()
|
|
EnlargingBooleanArray(EnlargingBooleanArray other)
|
|
EnlargingBooleanArray(int length)
|
|
EnlargingBooleanArray(int length,
boolean DEFAULT)
|
|
| Method Summary | |
boolean |
add(boolean obj)
|
void |
appendTo(ToString s)
|
void |
clear()
|
static void |
copy(EnlargingBooleanArray src,
int srcIndex,
EnlargingBooleanArray dst,
int dstIndex,
int length)
|
private void |
enlarge(int newLength)
|
void |
fill(int start,
int stop,
boolean value)
|
boolean |
get(int idx)
|
BooleanIterator |
iterator()
|
void |
move(int moveSrc,
int moveDst,
int moveLength)
|
void |
permute(Permutation permutation)
Permutes the contents of this array. |
boolean |
pop()
Returns the element at position size() - 1
and shrinks the size of this array by 1. |
boolean |
remove(int idx)
|
boolean |
set(int idx,
boolean obj)
|
void |
setSize(int size)
|
int |
size()
|
boolean |
test(int idx)
Same as get(int), except for indices larger than or
equal to the array length. |
boolean[] |
toArray(boolean[] a)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final boolean DEFAULT
int length
boolean[] array
public static final int MIN_SIZE
| Constructor Detail |
public EnlargingBooleanArray()
public EnlargingBooleanArray(int length)
public EnlargingBooleanArray(int length,
boolean DEFAULT)
public EnlargingBooleanArray(EnlargingBooleanArray other)
| Method Detail |
public boolean get(int idx)
public boolean test(int idx)
get(int), except for indices larger than or
equal to the array length. For these cases, test(int)
returns a null value instead of throwing an exception.
public boolean set(int idx,
boolean obj)
public static void copy(EnlargingBooleanArray src,
int srcIndex,
EnlargingBooleanArray dst,
int dstIndex,
int length)
public boolean add(boolean obj)
public boolean remove(int idx)
public boolean pop()
size() - 1
and shrinks the size of this array by 1. This method enables a
stack-like usage of this array.
public void permute(Permutation permutation)
n is moved to index
permutation.compute(n).
public void setSize(int size)
public int size()
public void clear()
public void move(int moveSrc,
int moveDst,
int moveLength)
public void fill(int start,
int stop,
boolean value)
private final void enlarge(int newLength)
public BooleanIterator iterator()
public boolean[] toArray(boolean[] a)
public java.lang.String toString()
public void appendTo(ToString s)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||