|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object i3.dragos.core.runmode.RunMode
public class RunMode
This class provides methods to evaluate and change the application's run mode. In general, two alternatives for each method is given: One operating on the switch identifier, and another one operating on the switch value. The 'value' in the second case does not refer to the actual state of the switch, but on the value used internally. Users are advised to use the second method, as operations are noticeably faster. Also see the respective method documentation.
Constructor Summary | |
---|---|
RunMode()
constructor to initialize the RunMode object. |
Method Summary | |
---|---|
void |
disableAll()
Disables all switches. |
boolean |
isIDEnabled(byte id)
Test a run mode switch, given by its identifier. |
boolean |
isValueEnabled(int value)
Test a run mode switch, given by its value. |
boolean |
setIDState(byte id,
boolean enable)
Set a run mode switch to some value, given by its identifier. |
boolean |
setValueState(int value,
boolean enable)
Set a run mode switch to some value, given by its identifier. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RunMode()
Method Detail |
---|
public boolean isIDEnabled(byte id)
isValueEnabled(int)
instead, passing a
constant holding the switch value. This value can be statically dervied
from the identifier by the bit-shift operation 1 << id
.
id
- switch to test
true
if the switch is enabled, false
otherwise.public boolean isValueEnabled(int value)
value
- switch to test
true
if the switch is enabled, false
otherwise.public boolean setIDState(byte id, boolean enable)
setValueState(int, boolean)
instead, passing a constant holding
the switch value. This value can be statically dervied from the
identifier by the bit-shift operation 1 << id
.
id
- switch to setenable
- true
to enable the switch, false
to disable
true
if the switch was enabled before this method
call, false
otherwise.public boolean setValueState(int value, boolean enable)
value
- switch to setenable
- true
to enable the switch, false
to disable
true
if the switch was enabled before this method
call, false
otherwise.public void disableAll()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |