|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.shell.text.TrueFalseFormat
public final class TrueFalseFormat
This class is used to define a format for true/false values. The string "true" is considered here equivalent to the boolean value true, and "false" is considered here equivalent to the boolean value false. Lower and upper case characters are treated as equivalent.
Constructor Summary | |
---|---|
TrueFalseFormat()
Constructs a new true/false format object. |
Method Summary | |
---|---|
java.lang.String |
format(boolean b)
Returns "true" or "false" depending on the provided boolean value. |
java.lang.String |
format(java.lang.Boolean b)
Returns "true" or "false" depending on the provided boolean value. |
java.lang.Boolean |
parse(java.lang.String b)
Parses the provided string and returns its corresponding boolean value. |
boolean |
parsePrimitive(java.lang.String b)
Parses the provided string and returns its corresponding boolean value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TrueFalseFormat()
Method Detail |
---|
public java.lang.String format(java.lang.Boolean b)
format
in interface BooleanFormat
format
in interface Formatter<java.lang.Boolean>
b
- the boolean value to be formatted.
b
is true
;
"false" if b
is false
.public java.lang.String format(boolean b)
format
in interface BooleanFormat
b
- the boolean value to be formatted.
b
is true
;
"false" if b
is false
.public java.lang.Boolean parse(java.lang.String b)
parse
in interface BooleanFormat
parse
in interface Parser<java.lang.Boolean>
b
- the string to be parsed.
true
if b
matches "true";
false
if b
matches "false".
FormatException
- if the provided string
does not match "true" or "false".public boolean parsePrimitive(java.lang.String b)
parsePrimitive
in interface BooleanFormat
b
- the string to be parsed.
true
if b
matches "true";
false
if b
matches "false".
FormatException
- if the provided string
does not match "true" or "false".
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |