planetj.database.field
Class NumberField

java.lang.Object
  |
  +--planetj.database.Field
        |
        +--planetj.database.field.StringOrNumberField
              |
              +--planetj.database.field.NumberField
All Implemented Interfaces:
Cloneable, ICSVField, IExternallyNamed, IFDFObject, IGuarded, INamed, IXMLObject, Serializable
Direct Known Subclasses:
BigDecimalField, BigIntegerField, YearField

public abstract class NumberField
extends StringOrNumberField
implements Cloneable, Serializable

Author:
PlanetJ Corporation
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class planetj.database.Field
Field.FieldLocation
 
Field Summary
 
Fields inherited from interface planetj.dataengine.security.IGuarded
TYPE_ID_UNKNOWN, TYPE_NAME_FIELD, TYPE_NAME_SQLOPERATION, TYPE_SECURED_BY_LEVEL, TYPE_SECURED_BY_OPERATION, TYPE_UNSECURED
 
Constructor Summary
NumberField()
           
 
Method Summary
 String getDisplayValue()
          Returns the display value of this Field as a String.
 String getExternalValidationKey()
          Get the key that may be used to uniquely identify Field subclasses for external validation.
 BigDecimal getValueAsBigDecimal()
          Returns a BigDecimal value.
 boolean getValueAsBoolean()
          Subclasses must override this to detirmine what their boolean value is.
abstract  boolean isIntegersOnly()
          Test if this field can only contain integer values
 boolean isNumeric()
          This is a Number field.
 boolean isString()
          This is not a String field.
 boolean isValidLength(ExecutingContext ec)
          Tests if the field's value is too long
 boolean isValidValue(ExecutingContext ec)
          Validate this Field value.
 boolean isValueEqual(Object obj)
          Returns a boolean indicating if this field is equal to the supplied object.
 boolean isValueGreaterThan(Object obj)
          Returns a boolean indicating if this field is greater than the supplied object.
 boolean isValueLessThan(Object obj)
          Returns a boolean indicating if this field is less then the supplied object.
 void setValue(Object pValue)
          Sets the current value of the Field to the specified value, and also sets the old value to the previous value.
 
Methods inherited from class planetj.database.field.StringOrNumberField
createObject, getCopiedValue, getDefaultDatabaseValue, getSQLValue
 
Methods inherited from class planetj.database.Field
addFieldClassForDataClass, addPropertyChangeListener, appendSQLColumnDefinition, appendSQLNameAndValue, appendSQLNameAndValue, clearValidationExceptions, cloneField, commitValue, concat, create, create, createFromDataType, divide, equals, executeGetterMethod, executeSetterMethod, getAssociationOperation, getAttribute, getAutoUpdateValue, getColumnSpan, getConfigProperty, getCSVField, getCurrentValue, getCurrentValueAsString, getDataSQLOperation, getDate, getDefaultExternalName, getDefaultUsageId, getDefaultValue, getDisplayHeight, getDisplayLength, getDisplayOrder, getDisplayWidth, getExternalName, getFDFData, getFieldClassForDataClass, getFieldDescriptor, getFieldDescriptorSource, getFieldIncrementor, getIndex, getLibrary, getLibraryName, getMaxLength, getMaxLength, getMetaDataSystemAlias, getName, getOldValue, getOldValueAsString, getPossibleValues, getPossibleValues, getPreferredDisplayLength, getPreferredJavaDataType, getRow, getSecuredTypeId, getSecuredTypeName, getSecurityType, getSQLColumnDefinition, getSQLColumnDefinition, getSQLNameAndDefaultValue, getSQLNameAndValue, getSQLNameAndValue, getSQLObject, getSQLType, getSQLType, getSQLTypeName, getSQLTypeName, getSQLValue, getSQLValue, getStaticAttribute, getStyleClass, getStyleClass, getSystem, getSystemAlias, getSystemURL, getTable, getTableName, getValidationExceptions, getValidationInvalidLengthString, getValidationInvalidMinLengthString, getValidationInvalidValueString, getValidationInvalidValueString, getValidationRequiredString, getValidValuesString, getValue, getValueAsByte, getValueAsDate, getValueAsDouble, getValueAsFloat, getValueAsFullLengthString, getValueAsInt, getValueAsLong, getValueAsNumber, getValueAsShort, getValueAsString, getXMLData, getXMLTag, guessFieldClassProbability, handlePossibleValueOperation, hasMultipleStyleClasses, hasOldValue, hasPossibleValuesKeyClassOrOp, hasPossibleValuesSQLOperation, hasPossibleValuesSQLOperation, hasValue, isApplicable, isAuthorizedForEdit, isAuthorizedForRead, isAutoUpdateValue, isBoolean, isChanged, isContainsValue, isCurrentValueField, isCurrentValueString, isDate, isDecimalSQLType, isDecimalSQLType, isDefaultValue, isDerived, isDisplayable, isFieldContentDisplayable, isFieldValueDatabaseDefault, isFieldValueNotBlank, isFieldValueNull, isFileUpload, isGuarded, isHelpTextPresent, isInitialized, isNumericSQLType, isNumericSQLType, isPassword, isPhysical, isPossibleValuesSearch, isReadOnly, isReadOnly, isRequired, isRequired, isRequiredOnSearch, isSkeleton, isStringSQLType, isStringSQLType, isTime, isUpdateable, isValidationRequiredForAutoPopulate, isValidLength, isValidMinLength, isValidRequired, isValidRequired, isValidValue, isValueEqualToString, lessThan, removePropertyChangeListener, rollbackChanges, setAttribute, setChanged, setClonedValues, setDate, setFieldContentDisplayable, setFieldDescriptor, setInitialValue, setInitialValueAsString, setMaxLength, setName, setRow, setSavepoint, setSQLType, setSQLTypeName, setStaticAttribute, setTable, setValue, setValue, setValueAsString, setValueToDefault, toString, toUpperCase, validate, validate, validate
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumberField

public NumberField()
Method Detail

getDisplayValue

public String getDisplayValue()
Returns the display value of this Field as a String. If this Number is defined by the field data to be a currency, then the number is returned as a currency. However, if a formatter is specified, we only apply the formatters changes.

Overrides:
getDisplayValue in class Field
Returns:
java.lang.String

getExternalValidationKey

public String getExternalValidationKey()
Get the key that may be used to uniquely identify Field subclasses for external validation. That is validation outside the Field itself. e.g. Javascript.

Overrides:
getExternalValidationKey in class Field

getValueAsBigDecimal

public BigDecimal getValueAsBigDecimal()
Returns a BigDecimal value.

Returns:
BigDecimal

getValueAsBoolean

public boolean getValueAsBoolean()
Subclasses must override this to detirmine what their boolean value is. Returns a primitive that represents the value in the specified field.

Specified by:
getValueAsBoolean in class Field
Returns:
boolean

isIntegersOnly

public abstract boolean isIntegersOnly()
Test if this field can only contain integer values


isNumeric

public boolean isNumeric()
This is a Number field.

Overrides:
isNumeric in class Field

isString

public boolean isString()
This is not a String field.

Overrides:
isString in class Field
Returns:
boolean

isValidLength

public boolean isValidLength(ExecutingContext ec)
Tests if the field's value is too long

Overrides:
isValidLength in class Field
Parameters:
ec - The current executing context, which may be null
Returns:
boolean true if valid

isValidValue

public boolean isValidValue(ExecutingContext ec)
Validate this Field value. If the field value is valid, return true,

Overrides:
isValidValue in class Field
Parameters:
ec - The executing context, which may be null
Returns:
boolean true if valid

isValueEqual

public boolean isValueEqual(Object obj)
Returns a boolean indicating if this field is equal to the supplied object. the Row the Field belongs to. Subclasses should override and implement as appropriate.

Overrides:
isValueEqual in class StringOrNumberField
Returns:
boolean

isValueGreaterThan

public boolean isValueGreaterThan(Object obj)
Returns a boolean indicating if this field is greater than the supplied object. the Row the Field belongs to. Subclasses should override and implement as appropriate.

Overrides:
isValueGreaterThan in class StringOrNumberField
Returns:
boolean

isValueLessThan

public boolean isValueLessThan(Object obj)
Returns a boolean indicating if this field is less then the supplied object. the Row the Field belongs to. Subclasses should override and return the appropriate response.

Overrides:
isValueLessThan in class StringOrNumberField
Returns:
boolean

setValue

public void setValue(Object pValue)
              throws CMException
Sets the current value of the Field to the specified value, and also sets the old value to the previous value. If called and the Field is not updatable a CMException is thrown.

Overrides:
setValue in class StringOrNumberField
CMException