info.informatica.text.format
Class FloatFormat

java.lang.Object
  extended by info.informatica.text.format.ObjectFormat
      extended by info.informatica.text.format.NumberFormat
          extended by info.informatica.text.format.FloatFormat
All Implemented Interfaces:
Alignable
Direct Known Subclasses:
ExponentFormat

public class FloatFormat
extends NumberFormat

Author:
amengual at informatica dot info

Field Summary
 
Fields inherited from interface info.informatica.doc.style.Alignable
CENTER, JUSTIFY, LEFT, RIGHT, UNDETERMINED
 
Constructor Summary
FloatFormat()
           
 
Method Summary
static FloatFormat create(String format, DecimalFormatSymbols symbols)
          Creates the proper FloatFormat object according to format.
static FloatFormat create(String format, Locale locale)
          Creates the proper FloatFormat object according to format.
 String format(Object o)
          Formats an object according to the format specification set by setFormat.
 DecimalFormatSymbols getDecimalFormatSymbols()
          Gets the decimal format symbols.
 Object sample()
          Produce a sample of this format.
 void setDecimalFormatSymbols(DecimalFormatSymbols symbols)
          Sets the decimal format symbols.
 String toString()
           
 
Methods inherited from class info.informatica.text.format.ObjectFormat
align, create, create, create, getAlignment
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FloatFormat

public FloatFormat()
Method Detail

create

public static FloatFormat create(String format,
                                 Locale locale)
                          throws SpecParsingException
Creates the proper FloatFormat object according to format.

Parameters:
format - the format
locale - the locale for symbols.
Returns:
the FloatFormat object for format
Throws:
SpecParsingException

create

public static FloatFormat create(String format,
                                 DecimalFormatSymbols symbols)
                          throws SpecParsingException
Creates the proper FloatFormat object according to format.

Parameters:
format - the format
symbols - the symbols to use in decimal formatting.
Returns:
the FloatFormat object for format
Throws:
SpecParsingException

format

public String format(Object o)
Description copied from class: ObjectFormat
Formats an object according to the format specification set by setFormat.

Must be overriden by subclasses.

Specified by:
format in class ObjectFormat

setDecimalFormatSymbols

public void setDecimalFormatSymbols(DecimalFormatSymbols symbols)
Sets the decimal format symbols. The symbols are generally locale-dependent.

Parameters:
symbols - the new DecimalFormatSymbols

getDecimalFormatSymbols

public DecimalFormatSymbols getDecimalFormatSymbols()
Gets the decimal format symbols.

Returns:
the DecimalFormatSymbols

toString

public String toString()
Overrides:
toString in class Object

sample

public Object sample()
Description copied from class: ObjectFormat
Produce a sample of this format.

Specified by:
sample in class ObjectFormat
Returns:
a String with a (more or less) random object appropriate to be formatted according to current format specifications.