IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.gui
Class NumericConverter

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

public class NumericConverter
extends Converter
implements java.io.Serializable

The NumericConverter class is responsible for Numeric validation and conversion.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.dse.gui.Converter
propertyChange
 
Constructor Summary
NumericConverter()
          This constructor creates a NumericConverter object.
NumericConverter(java.lang.String em)
          This constructor creates a NumericConverter object.
NumericConverter(java.lang.String em, boolean isNull)
          This constructor creates a NumericConverter object.
NumericConverter(java.lang.String em, boolean isNull, boolean isConvertible)
          This constructor creates a NumericConverter object.
 
Method Summary
 java.lang.Object formatAsConversionType(java.lang.String aString)
          Converts a String into the same String.
 java.lang.String formatFromConversionType(java.lang.Object anObject)
          Converts an Object into a String.
 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

NumericConverter

public NumericConverter()
This constructor creates a NumericConverter object.


NumericConverter

public NumericConverter(java.lang.String em)
This constructor creates a NumericConverter object.

Parameters:
em - java.lang.String, the error message

NumericConverter

public NumericConverter(java.lang.String em,
                        boolean isNull)
This constructor creates a NumericConverter object.

Parameters:
em - java.lang.String, the error message
isNull - boolean

NumericConverter

public NumericConverter(java.lang.String em,
                        boolean isNull,
                        boolean isConvertible)
This constructor creates a NumericConverter object.

Parameters:
em - java.lang.String
isNull - boolean
isConvertible - boolean, indicates if it is Euro-EMU convertible or not
Method Detail

formatAsConversionType

public java.lang.Object formatAsConversionType(java.lang.String aString)
Converts a String into the same String.

Specified by:
formatAsConversionType in class Formatter
Parameters:
aString - java.lang.String, the String to be converted
Returns:
Object - the result of converting the aString parameter into a String. Value null is returned in case the parameter has value null or null length.

formatFromConversionType

public java.lang.String formatFromConversionType(java.lang.Object anObject)
Converts an Object into a String.

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

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