common-util

local.tomas.i18n
Class BooleanFormat

java.lang.Object
  extended by java.text.Format
      extended by local.tomas.i18n.BooleanFormat
All Implemented Interfaces:
Serializable, Cloneable

public class BooleanFormat
extends Format

Formatter for boolean values.

Author:
tomas.teubner
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.Format
Format.Field
 
Method Summary
 StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
           
static Locale[] getAvailableLocales()
          Get available locales.
 BooleanFormat getInstance(Locale locale)
          Get singleton instance.
 Boolean parse(String source)
          Parse string containing representation of boolean.
 Object parseObject(String source, ParsePosition pos)
           
 
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
 

Method Detail

getInstance

public BooleanFormat getInstance(Locale locale)
Get singleton instance.

Parameters:
locale - locale required for the instance
Returns:
the instance

getAvailableLocales

public static Locale[] getAvailableLocales()
Get available locales.

Returns:
array of available locales

format

public StringBuffer format(Object obj,
                           StringBuffer toAppendTo,
                           FieldPosition pos)
Specified by:
format in class Format
Throws:
IllegalArgumentException - if object is not Boolean

parseObject

public Object parseObject(String source,
                          ParsePosition pos)
Specified by:
parseObject in class Format

parse

public Boolean parse(String source)
              throws ParseException
Parse string containing representation of boolean.

Parameters:
source - the string
Returns:
the boolean value
Throws:
ParseException

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.