|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sandev.basics.util.IntReference
Holds a reference to an int. This is useful if you are doing a recursive traversal through a tree structure and want to keep track of which line you are on without using a state variable in the current class. This essentially gives you an int state variable that can be referenced from wherever you are regardless of recursion level.
| Field Summary | |
protected int |
value
The int reference. |
| Constructor Summary | |
IntReference()
|
|
| Method Summary | |
int |
decrementValue()
Return the current value and then decrement it. |
int |
getValue()
Accessor for value. |
int |
incrementValue()
Return the current value and then increment it. |
void |
setValue(int val)
Mutator for value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int value
| Constructor Detail |
public IntReference()
| Method Detail |
public void setValue(int val)
public int getValue()
public int incrementValue()
public int decrementValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||