|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.quick.BooleanStateArray
The class BooleanStateArray tracks a
boolean state corresponding to a list of int keys
provided in the class constructor.
| Field Summary | |
private int[] |
keys
The array of int keys. |
private boolean[] |
states
The corresponding array of boolean states. |
| Constructor Summary | |
BooleanStateArray(int[] list)
Initializes the BooleanStateArray with the list of keys whose boolean state will be maintained. |
|
| Method Summary | |
boolean |
getState(int key)
Returns the boolean state of the given key. |
void |
setAllStates(boolean state)
Sets all states to the given state. |
void |
setState(int[] list,
boolean state)
Sets the states in the given list of keys to the given state. |
void |
setState(int key,
boolean state)
Sets the boolean state of the given key. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int[] keys
private boolean[] states
| Constructor Detail |
public BooleanStateArray(int[] list)
This list cannot be changed after construction.
If the given list contains duplicate int entries, such duplicates will be removed in the internal data structure.
list - the list of keys that will be associated
with boolean states| Method Detail |
public boolean getState(int key)
Returns the boolean state of the given key.
Returns false if the key was not given in the list provided to the constructor.
key - the key whose state is desired
public void setState(int key,
boolean state)
Sets the boolean state of the given key.
Does nothing if the key was not given in the list provided to the constructor.
key - the key whose state is to be setstate - the state to set
public void setState(int[] list,
boolean state)
Sets the states in the given list of keys to the given state.
list - the list of keys whose state is to be setstate - the state to setpublic void setAllStates(boolean state)
Sets all states to the given state.
state - the state to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||