com.ibm.as400.ui.framework.java
Class FloatFormatter

java.lang.Object
  extended by com.ibm.as400.ui.framework.java.DataFormatter
      extended by com.ibm.as400.ui.framework.java.FloatFormatter

public class FloatFormatter
extends DataFormatter

Formatter for exchanging Float values between DataBeans and user interface components. If parsing is unsuccessful, an IllegalUserDataException is thrown.

Since:
v4r2m0
Version:
1.0, 06/01/98
Author:
B. Cragun
See Also:
DataFormatter, IllegalUserDataException

Constructor Summary
Constructor and Description
FloatFormatter(double minValue, double maxValue)
          Constructs a FloatFormatter.
 
Method Summary
Modifier and Type Method and Description
 String format(double dnumber)
          Format a double number
 String format(Object obj)
          Format a number as floating point based on the current locale Throws an IllegalArgumentException if the object is not an instance of Double, Float, Long, or Integer.
 Object parse(String source)
          Parses a string to produce a Double object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatFormatter

public FloatFormatter(double minValue,
                      double maxValue)
Constructs a FloatFormatter.

Parameters:
minValue - the minimum value required
maxValue - the maximum value required
Since:
v4r2m0
Method Detail

format

public String format(double dnumber)
Format a double number

Parameters:
dnumber - a valid double number.
Since:
v5r1m0

format

public String format(Object obj)
Format a number as floating point based on the current locale Throws an IllegalArgumentException if the object is not an instance of Double, Float, Long, or Integer.

Overrides:
format in class DataFormatter
Parameters:
obj - a valid Double, Float, Long, or Integer object cast as an object.
Returns:
formatted string
Since:
v5r1m0

parse

public Object parse(String source)
             throws IllegalUserDataException
Parses a string to produce a Double object. Throws an IllegalUserDataException if parsing fails.

Overrides:
parse in class DataFormatter
Parameters:
source - the string to be parsed
Returns:
the Double object obtained by parsing the string
Throws:
IllegalUserDataException
Since:
v4r2m0