org.oreodata.metadata
Class NumericalField

java.lang.Object
  |
  +--org.oreodata.metadata.Field
        |
        +--org.oreodata.metadata.NumericalField
All Implemented Interfaces:
FieldDescriptor, java.io.Serializable

public class NumericalField
extends Field

A descriptor for a field that holds a single numerical value.

Author:
Jonathan Revusky
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.oreodata.metadata.Field
defaultValueString, intern, properties, sqlType
 
Constructor Summary
NumericalField()
           
 
Method Summary
 void checkValidValue(Record rec, java.lang.Object value)
          Note that the min-max interval is [min, max) following python range semantics.
 java.lang.Class getJavaType()
          The kind of java object that can live in this record field.
 java.lang.Object getObjectFromString(Record rec, java.lang.String s)
          Given the string representation of a field, return its internal java object representation.
 void init(org.w3c.dom.Element element)
           
 java.lang.String normalize(java.lang.String s)
          "normalize" the string passed in.
protected  void processProperties()
           
 
Methods inherited from class org.oreodata.metadata.Field
convertFromJDBC, convertToJDBC, createSAXHandler, defaultValue, getCopy, getLocalizedName, getName, getProperty, getSQLType, hashCode, intern, isFieldOf, isRequired, isSetExternally, processDefaultValue, processNormalization, setDefaultValue, toString, valueToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumericalField

public NumericalField()
Method Detail

init

public void init(org.w3c.dom.Element element)
          throws org.xml.sax.SAXException
Overrides:
init in class Field
org.xml.sax.SAXException

processProperties

protected void processProperties()
                          throws org.xml.sax.SAXException
Overrides:
processProperties in class Field
org.xml.sax.SAXException

getJavaType

public java.lang.Class getJavaType()
Description copied from interface: FieldDescriptor
The kind of java object that can live in this record field.

Specified by:
getJavaType in interface FieldDescriptor
Overrides:
getJavaType in class Field

normalize

public java.lang.String normalize(java.lang.String s)
Description copied from interface: FieldDescriptor
"normalize" the string passed in. For example, with a case-insensitive string field, this method would return the lower case version of the string (or upper case if that is the "normal" form.)

Specified by:
normalize in interface FieldDescriptor
Overrides:
normalize in class Field
Returns:
the "normalized" string

getObjectFromString

public java.lang.Object getObjectFromString(Record rec,
                                            java.lang.String s)
                                     throws DataException
Description copied from interface: FieldDescriptor
Given the string representation of a field, return its internal java object representation. Used in deserializing from a flat file.

DataException

checkValidValue

public void checkValidValue(Record rec,
                            java.lang.Object value)
                     throws DataException
Note that the min-max interval is [min, max) following python range semantics.

Specified by:
checkValidValue in interface FieldDescriptor
Overrides:
checkValidValue in class Field
DataException