com.ibm.dse.gui
Class NumericConverter
java.lang.Object
|
+--com.ibm.dse.gui.Formatter
|
+--com.ibm.dse.gui.Converter
|
+--com.ibm.dse.gui.NumericConverter
- public class NumericConverter
- extends Converter
- implements java.io.Serializable
The NumericConverter class is responsible for Numeric validation and conversion.
- See Also:
- Serialized Form
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 java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
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 messageisNull
- boolean
NumericConverter
public NumericConverter(java.lang.String em,
boolean isNull,
boolean isConvertible)
- This constructor creates a NumericConverter object.
- Parameters:
em
- java.lang.StringisNull
- booleanisConvertible
- boolean, indicates if it is Euro-EMU convertible or not
formatAsConversionType
public java.lang.Object formatAsConversionType(java.lang.String aString)
- Converts a String into the same String.
- Overrides:
- 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.
- Overrides:
- 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.