All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class datarep.common.ValidatedTextField

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.TextComponent
                   |
                   +----java.awt.TextField
                           |
                           +----datarep.common.ValidatedTextField

public class ValidatedTextField
extends TextField
The ValidatedTextField class is a very useful class. It creates a text field which only accepts a certain type of data. In addition to fundamental Java types such as int, long, etc., there are more complex types, such as PHONE, which accept input only so that it makes a valid phone number.

Version:
1.2
Author:
Data Representations, Inc.

Variable Index

 o BOOLEAN
 o BYTE
 o CHAR
 o CHARACTER
 o DATE
 o DATE2000
 o DOLLAR
 o DOUBLE
 o FLOAT
 o IDENTIFIER
 o INT
 o INTEGER
 o LONG
 o MAX_TYPES
 o NULL
 o PHONE
 o SHORT
 o SOCIAL_SECURITY
 o STRING
 o TIME
 o ZIP
 o ZIP4

Constructor Index

 o ValidatedTextField()
creates a new Validated text field of type null (no validation)
 o ValidatedTextField(int)
Creates a new Validated text field of type validationType.
 o ValidatedTextField(int, int)
Creates a new Validated text field of specified type and with the specified number of columns.
 o ValidatedTextField(int, String)
creates a new Validated text field of specified type, with the specified starting text.
 o ValidatedTextField(int, String, int)

Method Index

 o booleanValue()
returns the value of the textfield as a boolean.
 o byteValue()
returns the value of the validated textfield as a byte.
 o charValue()
returns the value of the validated textfield as a char.
 o doubleValue()
returns the value of the validated textfield as a double.
 o floatValue()
returns the value of the validated textfield as a float.
 o getValidationType()
returns an integer corresponding to the type of validation.
 o getValue()
getValue() returns the value of the textfield as an Object.
 o intValue()
returns the value of the validated textfield as a integer.
 o isEmpty()
 o isSet()
returns true if there is data in the validated textfield; false otherwise.
 o longValue()
returns the value of the validated textfield as a long.
 o setValidationType(int)
if the Validated text field is a complex type, this sets the field to contain some dummy text demonstrating the type of input which is acceptable.
 o shortValue()
returns the value of the validated textfield as a short.

Variables

 o NULL
 public static final int NULL
 o BYTE
 public static final int BYTE
 o SHORT
 public static final int SHORT
 o INTEGER
 public static final int INTEGER
 o INT
 public static final int INT
 o LONG
 public static final int LONG
 o CHARACTER
 public static final int CHARACTER
 o CHAR
 public static final int CHAR
 o FLOAT
 public static final int FLOAT
 o DOUBLE
 public static final int DOUBLE
 o STRING
 public static final int STRING
 o BOOLEAN
 public static final int BOOLEAN
 o PHONE
 public static final int PHONE
 o SOCIAL_SECURITY
 public static final int SOCIAL_SECURITY
 o ZIP
 public static final int ZIP
 o ZIP4
 public static final int ZIP4
 o DOLLAR
 public static final int DOLLAR
 o TIME
 public static final int TIME
 o DATE
 public static final int DATE
 o DATE2000
 public static final int DATE2000
 o IDENTIFIER
 public static final int IDENTIFIER
 o MAX_TYPES
 public static final int MAX_TYPES

Constructors

 o ValidatedTextField
 public ValidatedTextField()
creates a new Validated text field of type null (no validation)

 o ValidatedTextField
 public ValidatedTextField(int validationType)
Creates a new Validated text field of type validationType.

 o ValidatedTextField
 public ValidatedTextField(int validationType,
                           int col)
Creates a new Validated text field of specified type and with the specified number of columns.

 o ValidatedTextField
 public ValidatedTextField(int validationType,
                           String text)
creates a new Validated text field of specified type, with the specified starting text.

 o ValidatedTextField
 public ValidatedTextField(int validationType,
                           String text,
                           int col)

Methods

 o getValidationType
 public int getValidationType()
returns an integer corresponding to the type of validation.

 o setValidationType
 public void setValidationType(int validationType)
if the Validated text field is a complex type, this sets the field to contain some dummy text demonstrating the type of input which is acceptable.
for example, calling setValidatationType(ValidatedTextField.PHONE) would set a field to contain the following string: "(000)000-0000".

 o getValue
 public Object getValue()
getValue() returns the value of the textfield as an Object.

 o byteValue
 public byte byteValue()
returns the value of the validated textfield as a byte. If data inappropriate for a byte is found, it will be converted into something reasonable.

 o shortValue
 public short shortValue()
returns the value of the validated textfield as a short. If data inappropriate for a short is found, it will be converted into something reasonable.

 o intValue
 public int intValue()
returns the value of the validated textfield as a integer. If data inappropriate for an integer is found, it will be converted into the most reasonable alternative. For example, "" will be converted to "0".

 o longValue
 public long longValue()
returns the value of the validated textfield as a long. If data inappropriate for a long is found, it will be converted into something reasonable.

 o floatValue
 public float floatValue()
returns the value of the validated textfield as a float. If data inappropriate for a float is found, it will be converted into something reasonable.

 o doubleValue
 public double doubleValue()
returns the value of the validated textfield as a double. If data inappropriate for a double is found, it will be converted into something reasonable.

 o charValue
 public char charValue()
returns the value of the validated textfield as a char. If data inappropriate for a char is found, an attempt will be made to return an appropriate value.

 o booleanValue
 public boolean booleanValue()
returns the value of the textfield as a boolean. If the validated textfield does not contain 'true' or 'false', then 'false' will be returned.

 o isSet
 public boolean isSet()
returns true if there is data in the validated textfield; false otherwise.

 o isEmpty
 public boolean isEmpty()

All Packages  Class Hierarchy  This Package  Previous  Next  Index