|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.text.Format
net.sf.fikin.pojostate.format.BooleanFormat
public class BooleanFormat
Default implementation of boolean format
It supports pattern configurable text representation for true and false. One has to pass following text to the constructor: "value-for-true;value-for-false".
Examples:
created on Jul 6, 2005
Format f = new BooleanFormat( "true;false" );
Format f = new BooleanFormat( "1;0" );
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.text.Format |
---|
java.text.Format.Field |
Constructor Summary | |
---|---|
BooleanFormat()
instantiate Boolean formatter with default strings "true" and "false" |
|
BooleanFormat(java.lang.String pattern)
instantiate new Boolean formatter with given pattern. |
Method Summary | |
---|---|
java.lang.StringBuffer |
format(java.lang.Object obj,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
format Boolean into predefined strings, one for true other for false. |
java.lang.Object |
parseObject(java.lang.String source,
java.text.ParsePosition pos)
not supported |
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 pattern)
Expected text is in the format "text for true:text for false".
pattern
- in the format "text for true:text for false"Method Detail |
---|
public java.lang.Object parseObject(java.lang.String source, java.text.ParsePosition pos)
parseObject
in class java.text.Format
source
- pos
-
public java.lang.StringBuffer format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
One can change the default "true" and "false" by instantiating the object with proper pattern text. See above documentation.
format
in class java.text.Format
obj
- has to be java.lang.BooleantoAppendTo
- to append the string representation of objpos
- is irrelevant in this method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |