IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.gui
Class FloatConverter

java.lang.Object
  extended bycom.ibm.dse.gui.Formatter
      extended bycom.ibm.dse.gui.Converter
          extended bycom.ibm.dse.gui.FloatConverter
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class FloatConverter
extends Converter

The FloatConverter class is responsible for Float validation and conversion.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.dse.gui.Converter
propertyChange
 
Constructor Summary
FloatConverter()
          This constructor creates a FloatConverter object.
FloatConverter(java.lang.String text, java.lang.String sep, char decSep)
          This constructor creates a FloatConverter object.
FloatConverter(java.lang.String errorMessage, java.lang.String sep, char decSep, int decimals)
          This constructor creates a FloatConverter object.
FloatConverter(java.lang.String errorMessage, java.lang.String sep, char decSep, int decimals, boolean convertible)
          This constructor creates a FloatConverter object.
 
Method Summary
 java.lang.Object formatAsConversionType(java.lang.String text)
          Converts a String into a Float.
 java.lang.String formatFromConversionType(java.lang.Object input)
          Converts a Float into a String.
 char getDecimalSeparator()
          Gets the decimalSeparator property (char) value.
 NumericStringFormat getFormat()
          Gets the format property (NumericStringFormat) value.
 int getMaxNumberOfDecimals()
          Gets the maxNumberOfDecimals property (int) value.
 java.lang.String getSeparator()
          Gets the separator property (java.lang.String) value.
 void setDecimalSeparator(char decimalSeparator)
          Sets the decimalSeparator property (char) value.
 void setFormat(NumericStringFormat value)
          Sets the format property (NumericStringFormat) value.
 void setMaxNumberOfDecimals(int maxNumberOfDecimals)
          Sets the maxNumberOfDecimals property (int) value.
 void setSeparator(java.lang.String separator)
          Sets the separator property (java.lang.String) value.
 boolean validate(java.lang.String userInput)
          Returns a boolean that indicates if the validation has been achieved successfully or not.
 boolean validateKey(java.lang.String userInput, java.awt.event.KeyEvent keyEvent)
          Returns a boolean that indicates if the validation has been achieved successfully or not for this new key.
 
Methods inherited from class com.ibm.dse.gui.Converter
addPropertyChangeListener, firePropertyChange, getErrorMessage, getIsConvertible, getIsNull, getPropertyChange, removePropertyChangeListener, setErrorMessage, setIsConvertible, setIsNull, validateWithError
 
Methods inherited from class com.ibm.dse.gui.Formatter
format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatConverter

public FloatConverter()
This constructor creates a FloatConverter object.


FloatConverter

public FloatConverter(java.lang.String text,
                      java.lang.String sep,
                      char decSep)
This constructor creates a FloatConverter object.

Parameters:
text - java.lang.String, the errorMessage
sep - java.lang.String, the thousands separator
decSep - char, the decimal separator

FloatConverter

public FloatConverter(java.lang.String errorMessage,
                      java.lang.String sep,
                      char decSep,
                      int decimals)
This constructor creates a FloatConverter object.

Parameters:
errorMessage - java.lang.String, the error message
sep - java.lang.String, the thousands separator
decSep - char, the decimal separator
decimals - int, the number of decimals

FloatConverter

public FloatConverter(java.lang.String errorMessage,
                      java.lang.String sep,
                      char decSep,
                      int decimals,
                      boolean convertible)
This constructor creates a FloatConverter object.

Parameters:
errorMessage - java.lang.String, the error message
sep - java.lang.String, the thousands separator
decSep - char, the decimal separator
decimals - int, the number of decimals
convertible - boolean, indicates if it is Euro-EMU convertible or not
Method Detail

formatAsConversionType

public java.lang.Object formatAsConversionType(java.lang.String text)
Converts a String into a Float.

Specified by:
formatAsConversionType in class Formatter
Parameters:
text - java.lang.String, the String to be converted JR20357f_1
Returns:
Object - the result of converting the aString parameter into a Float

formatFromConversionType

public java.lang.String formatFromConversionType(java.lang.Object input)
Converts a Float into a String.

Specified by:
formatFromConversionType in class Formatter
Parameters:
input - Object, the float to be converted
Returns:
String - the result of converting the input parameter into a String

getDecimalSeparator

public char getDecimalSeparator()
Gets the decimalSeparator property (char) value.

Returns:
char - the decimalSeparator property value.
See Also:
setDecimalSeparator(char)

getFormat

public NumericStringFormat getFormat()
Gets the format property (NumericStringFormat) value.

Returns:
NumericStringFormat - the format property value.
See Also:
setFormat(com.ibm.dse.base.NumericStringFormat)

getMaxNumberOfDecimals

public int getMaxNumberOfDecimals()
Gets the maxNumberOfDecimals property (int) value.

Returns:
int - the maxNumberOfDecimals property value.
See Also:
setMaxNumberOfDecimals(int)

getSeparator

public java.lang.String getSeparator()
Gets the separator property (java.lang.String) value.

Returns:
String - the separator property value.
See Also:
setSeparator(java.lang.String)

setDecimalSeparator

public void setDecimalSeparator(char decimalSeparator)
Sets the decimalSeparator property (char) value.

See Also:
getDecimalSeparator()

setFormat

public void setFormat(NumericStringFormat value)
Sets the format property (NumericStringFormat) value.

See Also:
getFormat()

setMaxNumberOfDecimals

public void setMaxNumberOfDecimals(int maxNumberOfDecimals)
Sets the maxNumberOfDecimals property (int) value.

See Also:
getMaxNumberOfDecimals()

setSeparator

public void setSeparator(java.lang.String separator)
Sets the separator property (java.lang.String) value.

See Also:
getSeparator()

validate

public boolean validate(java.lang.String userInput)
Returns a boolean that indicates if the validation has been achieved successfully or not.

Overrides:
validate in class Converter
Parameters:
userInput - java.lang.String - the string to be validated
Returns:
boolean - the result of the validation

validateKey

public boolean validateKey(java.lang.String userInput,
                           java.awt.event.KeyEvent keyEvent)
Returns a boolean that indicates if the validation has been achieved successfully or not for this new key.

Overrides:
validateKey in class Converter
Parameters:
userInput - java.lang.String - the string writed.
keyEvent - java.awt.event.KeyEvent - new key.
Returns:
boolean - the result of the validation.

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005