|
ProgramixGenericLib v4.0.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.programix.util.TriState
public final class TriState
Holds one of three states: YES, NO, and UNKNOWN.
This can be used instead of a boolean to hold a third
state of "don't know" or "unknown".
This can also be used instead of a Boolean reference so that
"unknown" can be explicitly represented as opposed to using a
null reference to implicitly indicate "unknown".
| Field Summary | |
|---|---|
static TriState |
NO
Indicates that the state is known and that it is "no" (or "false", or "off", or "negative"). |
static TriState |
UNKNOWN
Indicates that the state is unknown (neither "yes" or "no" is known at this point). |
static List |
VALUE_LIST
An unmodifiable List of all the instances of TriState. |
static TriState |
YES
Indicates that the state is known and that it is "yes" (or "true", or "on", or "affirmative"). |
| Method Summary | |
|---|---|
int |
compareTo(Object obj)
|
boolean |
equals(Object obj)
|
String |
getName()
Returns the name of this instance, one of: "YES", "NO", or "UNKNOWN". |
static TriState[] |
getValues()
Returns an array of all the instances of TriState. |
int |
hashCode()
|
boolean |
isKnown()
Returns true if the state is either YES or
NO (not UNKNOWN). |
boolean |
isNo()
Returns true if the state is NO. |
boolean |
isNotNo()
Returns true if the state is not NO,
but is either YES or UNKNOWN. |
boolean |
isNotYes()
Returns true if the state is not YES,
but is either NO or UNKNOWN. |
boolean |
isUnknown()
Returns true if the state is neither YES nor
NO, but is UNKNOWN. |
boolean |
isYes()
Returns true if the state is YES. |
String |
toString()
|
static TriState |
valueOf(String name)
Returns the instance whose getName() method returns
a String that matches the name passed in. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final TriState YES
NO,
UNKNOWNpublic static final TriState NO
YES,
UNKNOWNpublic static final TriState UNKNOWN
YES,
NOpublic static final List VALUE_LIST
List of all the instances of TriState.
| Method Detail |
|---|
public static TriState[] getValues()
public static TriState valueOf(String name)
throws IllegalArgumentException
getName() method returns
a String that matches the name passed in.
The matching is done ignoring any case differences and after
trimming any leading or trailing whitespace on the string
passed in.
name - the name to search for.
IllegalArgumentException - if no match is found.public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic int compareTo(Object obj)
compareTo in interface Comparablepublic String getName()
public boolean isKnown()
YES or
NO (not UNKNOWN).
public boolean isUnknown()
YES nor
NO, but is UNKNOWN.
public boolean isYes()
YES.
public boolean isNotYes()
YES,
but is either NO or UNKNOWN.
public boolean isNo()
NO.
public boolean isNotNo()
NO,
but is either YES or UNKNOWN.
|
ProgramixGenericLib v4.0.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||