|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.text.Format
com.ibm.icu.text.UFormat
com.google.visualization.datasource.base.BooleanFormat
public class BooleanFormat
A UFormat that performs formatting and parsing for boolean values.
The string representation of boolean values is determined by two strings passed
to the constructor of this class; a string for TRUE and a string for
FALSE.
Examples for text strings representing a BooleanValue that can be
used in construction are:
1) true, false
2) TRUE, FALSE
2) t, f
3) yes, no
4) YES, NO
5) check, uncheck
6) Green, Red
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.text.Format |
|---|
java.text.Format.Field |
| Constructor Summary | |
|---|---|
BooleanFormat()
Creates a BooleanFormat with default true/false formatting. |
|
BooleanFormat(java.lang.String pattern)
Constructs a boolean format from a pattern. |
|
BooleanFormat(java.lang.String trueString,
java.lang.String falseString)
Creates a BooleanFormat. |
|
| Method Summary | |
|---|---|
java.lang.StringBuffer |
format(java.lang.Object obj,
java.lang.StringBuffer appendTo,
java.text.FieldPosition pos)
Formats a Boolean and appends the result to a StringBuffer. |
java.lang.Boolean |
parse(java.lang.String text)
Parses text from the beginning of the given string to produce a boolean. |
java.lang.Boolean |
parseObject(java.lang.String source,
java.text.ParsePosition pos)
Parses a string into a Boolean. |
| Methods inherited from class com.ibm.icu.text.UFormat |
|---|
getLocale |
| Methods inherited from class java.text.Format |
|---|
clone, format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BooleanFormat()
public BooleanFormat(java.lang.String trueString,
java.lang.String falseString)
trueString - A string representing true.falseString - A string representing false.public BooleanFormat(java.lang.String pattern)
pattern - The pattern from which to construct.| Method Detail |
|---|
public java.lang.StringBuffer format(java.lang.Object obj,
java.lang.StringBuffer appendTo,
java.text.FieldPosition pos)
format in class java.text.Formatobj - The object to format.appendTo - The StringBuffer to which the formatted string will be appended.pos - A FieldPosition param (not used in this class).
public java.lang.Boolean parseObject(java.lang.String source,
java.text.ParsePosition pos)
Boolean. A string can be either a trueString
or a falseString (non-case sensitive).
parseObject in class java.text.Formatsource - The string from which to parse.pos - Marks the end of the parsing, or 0 if the parsing failed.
Boolean for the parsed string.
public java.lang.Boolean parse(java.lang.String text)
throws java.text.ParseException
text - A String that should be parsed from it's start.
Boolean parsed from the string.
java.text.ParseException - If the string cannot be parsed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||