@Override
  public double getResult(double[] incoming) throws Exception {

    double result = Double.NaN;
    boolean found = false;
    
    for (int i = 0; i < m_fieldDefs.size(); i++) {
      Attribute a = m_fieldDefs.get(i);
      if (a.name().equals(m_fieldName)) {
        if (a.isNumeric()) {
          if (m_opType == FieldMetaInfo.Optype.CATEGORICAL ||
              m_opType == FieldMetaInfo.Optype.ORDINAL) {
            throw new IllegalArgumentException("[FieldRef] Optype is categorical/ordinal but matching "
                + "parameter is not!");         
          }          
        } else if (a.isNominal()) {
          if (m_opType == FieldMetaInfo.Optype.CONTINUOUS) {
            throw new IllegalArgumentException("[FieldRef] Optype is continuous but matching "
                + "parameter is not!");
          }
        } else {
          throw new IllegalArgumentException("[FieldRef] Unhandled attribute type");
        }
        result = incoming[i];
        found = true;
        break;
      }
    }
    
    if (!found) {
      throw new Exception("[FieldRef] this field: " + m_fieldName + " is not in the supplied "
          + "list of parameters!");
    }
    return result;
  }