|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.shell.text.YesNoFormat
public final class YesNoFormat
This class is used to define a format for yes/no values. The string "Yes" is considered here equivalent to the boolean value true, and "No" is considered here equivalent to the boolean value false.
Constructor Summary | |
---|---|
YesNoFormat()
Constructs a new yes/no format object. |
Method Summary | |
---|---|
java.lang.String |
format(boolean b)
Returns "Yes" or "No" depending on the provided boolean value. |
java.lang.String |
format(java.lang.Boolean b)
Returns "Yes" or "No" 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 YesNoFormat()
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
;
"No" 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
;
"No" 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 "Yes";
false
if b
matches "No".
FormatException
- if the provided string
does not match "Yes" or "No".public boolean parsePrimitive(java.lang.String b)
parsePrimitive
in interface BooleanFormat
b
- the string to be parsed.
true
if b
matches "Yes";
false
if b
matches "No".
FormatException
- if the provided string
does not match "Yes" or "No".
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |