com.penguinwerks.jodene.data
Class Field

java.lang.Object
  extended bycom.penguinwerks.jodene.data.Field
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
RealField, TranslatedField

public abstract class Field
extends java.lang.Object
implements java.io.Serializable

A field used to read in values. A field is a named entity that processes the raw text input into an array of resulting doubles. In most cases one input value = one output value. For non-numeric attributes (like color) the resulting values could be a multi-valued attribute.

Author:
Paul Hoehne
See Also:
Serialized Form

Constructor Summary
Field()
           
 
Method Summary
 java.lang.String getName()
          The field name.
abstract  double[] process(java.lang.String val)
          Abstract process method.
 void setName(java.lang.String name)
          The field name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Field

public Field()
Method Detail

getName

public java.lang.String getName()
The field name. Used to identify the field.

Returns:
Returns the name.

setName

public void setName(java.lang.String name)
The field name. Used to identify the field.

Parameters:
name - The name to set.

process

public abstract double[] process(java.lang.String val)
                          throws TranslatorException
Abstract process method. The implementation of this method translates a set of string, read from the data source, into an array of doubles. Normally, a real valued field translates a string value to an array of one double valued number.

Parameters:
val - The raw string to process.
Returns:
The list of doubles that the given string translates into.
Throws:
TranslatorException - Thrown if there is a problem translating the field.