voji.utils
Class BooleanFormat

java.lang.Object
  |
  +--java.text.Format
        |
        +--voji.utils.BooleanFormat
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class BooleanFormat
extends java.text.Format

This is a formatter for the Boolean type. It's useful for the SQL-Type "BIT" and when you don't like "TRUE" and "FALSE" in a user interface :-)

See Also:
Serialized Form

Constructor Summary
BooleanFormat()
          Creates a new BooleanFormat instance with default settings
BooleanFormat(java.lang.String stringTRUE, java.lang.String stringFALSE)
          Creates a new BooleanFormat instance
 
Method Summary
 java.lang.StringBuffer format(boolean bool, java.lang.StringBuffer toAppendTo, java.text.FieldPosition fieldPosition)
          Formats a boolean
 java.lang.StringBuffer format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition fieldPosition)
          Formats an Object
 java.lang.Boolean parse(java.lang.String text, java.text.ParsePosition pos)
          Parses a String
 java.lang.Object parseObject(java.lang.String text, java.text.ParsePosition pos)
          Parses a String
 
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

BooleanFormat

public BooleanFormat()
Creates a new BooleanFormat instance with default settings


BooleanFormat

public BooleanFormat(java.lang.String stringTRUE,
                     java.lang.String stringFALSE)
Creates a new BooleanFormat instance

Parameters:
stringTRUE - the String that is used for "TRUE"
stringFALSE - the String that is used for "FALSE"
Method Detail

format

public java.lang.StringBuffer format(java.lang.Object obj,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition fieldPosition)
Formats an Object

Specified by:
format in class java.text.Format

parseObject

public java.lang.Object parseObject(java.lang.String text,
                                    java.text.ParsePosition pos)
Parses a String

Specified by:
parseObject in class java.text.Format

format

public java.lang.StringBuffer format(boolean bool,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition fieldPosition)
Formats a boolean


parse

public java.lang.Boolean parse(java.lang.String text,
                               java.text.ParsePosition pos)
Parses a String