public class Stateful extends Object
| Constructor and Description |
|---|
Stateful()
Constructs a stateful object using arbitrary values.
|
Stateful(String text,
Number number,
Boolean truth)
Constructs a stateful object using specified values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
flip()
Modifies the state by inverting the logical value.
|
Number |
number()
Accesses the numeric component of state.
|
String |
text()
Accesses the text component of state.
|
String |
toString()
Renders object in the format:
Stateful[truth, number, "text"] |
Boolean |
truth()
Accesses the logic component of state.
|
public Boolean truth()
public Number number()
public String text()
public void flip()
true,
it is changed to false.
If the state value was false,
it is changed to true.