public class NormDiscrete extends Expression
| Modifier and Type | Field and Description |
|---|---|
protected Attribute |
m_field
The actual attribute itself
|
protected int |
m_fieldIndex
The index of the attribute
|
protected String |
m_fieldName
The name of the field to lookup our value in
|
protected String |
m_fieldValue
The actual value (as a String) that will correspond to an output of 1
|
protected int |
m_fieldValueIndex
If we are referring to a nominal (rather than String) attribute
then this holds the index of the value in question.
|
protected boolean |
m_mapMissingDefined
True if a replacement for missing values has been specified
|
protected double |
m_mapMissingTo
The value of the missing value replacement (if defined)
|
m_fieldDefs, m_opType| Constructor and Description |
|---|
NormDiscrete(Element normDisc,
FieldMetaInfo.Optype opType,
ArrayList<Attribute> fieldDefs)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected Attribute |
getOutputDef()
Return the structure of the result of applying this Expression
as an Attribute.
|
double |
getResult(double[] incoming)
Get the result of evaluating the expression.
|
String |
getResultCategorical(double[] incoming)
Always throws an Exception since the result of NormDiscrete must
be continuous.
|
void |
setFieldDefs(ArrayList<Attribute> fieldDefs)
Set the field definitions for this Expression to use
|
String |
toString(String pad) |
getExpression, getExpression, getFieldDef, getFieldDefIndex, getOptype, getResultContinuous, toStringprotected String m_fieldName
protected Attribute m_field
protected int m_fieldIndex
protected String m_fieldValue
protected boolean m_mapMissingDefined
protected double m_mapMissingTo
protected int m_fieldValueIndex
public NormDiscrete(Element normDisc, FieldMetaInfo.Optype opType, ArrayList<Attribute> fieldDefs) throws Exception
normDisc - the Element encapsulating this NormDiscreteopType - the optype for this expression (taken from either the
enclosing DefineFunction or DerivedField)fieldDefs - an ArrayList of Attributes for the fields that this
Expression might need to access
enclosing DefineFunction or DerivedField)Exception - if there is a problem parsing this Apply Expressionpublic void setFieldDefs(ArrayList<Attribute> fieldDefs) throws Exception
setFieldDefs in class ExpressionfieldDefs - the field definitions to useException - if there is a problem setting the field definitionsprotected Attribute getOutputDef()
getOutputDef in class Expressionpublic double getResult(double[] incoming)
throws Exception
getResult in class Expressionincoming - the incoming parameter valuesException - if there is a problem computing the resultpublic String getResultCategorical(double[] incoming) throws Exception
getResultCategorical in class Expressionincoming - the incoming parameter valuesException - alwayspublic String toString(String pad)
toString in class ExpressionCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.