sky.engine.field
Class IntField
java.lang.Object
sky.engine.field.BaseField
sky.engine.field.IntField
- All Implemented Interfaces:
- Field
- Direct Known Subclasses:
- SelectionField
- public class IntField
- extends BaseField
- implements Field
|
Constructor Summary |
IntField(java.lang.String name,
boolean required)
Constructor |
IntField(java.lang.String name,
boolean required,
java.lang.String dflt,
int maxlen,
int vislen)
Constructor |
|
Method Summary |
void |
addValue(java.lang.String value)
Add value to this field. |
java.lang.String |
checkValue(java.lang.String value)
Check to make sure that the input string actually contains an integer value. |
int |
getIntData(int pos)
Get a specific value of this field. |
| Methods inherited from class sky.engine.field.BaseField |
addAlias, clear, destory, getAliases, getData, getDataSize, getHTMLData, getName, getRequired, getSQLData, getStringData, hasAliases, hasValue, removeAliases, removeValues, toHTML, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface sky.engine.field.Field |
addAlias, clear, destory, getAliases, getDataSize, getHTMLData, getName, getRequired, getSQLData, getStringData, hasAliases, removeAliases, removeValues, toHTML, toString |
IntField
public IntField(java.lang.String name,
boolean required)
- Constructor
- Parameters:
name - field namerequired - true if a value is required for this field; else, false.
IntField
public IntField(java.lang.String name,
boolean required,
java.lang.String dflt,
int maxlen,
int vislen)
- Constructor
- Parameters:
name - field namerequired - true if a value is required for this field; else, false.dflt - default value of this field if user does not specify one.maxlen - maximum length of string representation of this field's value.vislen - visible length of the GUI field associated with this field.
checkValue
public java.lang.String checkValue(java.lang.String value)
throws ErrorMessage
- Check to make sure that the input string actually contains an integer value. This
method is called by the addValue method.
- Specified by:
checkValue in interface Field
- Parameters:
value - input parameter that will be checked or transformed.
- Returns:
- original input string.
- Throws:
ErrorMessage - if ther is a input string does not represent a valid integer.
addValue
public void addValue(java.lang.String value)
throws ErrorMessage
- Add value to this field.
- Specified by:
addValue in interface Field
- Parameters:
value - input string that represents an integer value.
- Throws:
ErrorMessage - if there is a problem in adding specified string as field value.
getIntData
public int getIntData(int pos)
- Get a specific value of this field.
- Parameters:
pos - index position of the value.
- Returns:
- value.