org.encog.util.normalize.output.mapped

## Class OutputFieldEncode

- java.lang.Object
- - org.encog.util.normalize.output.BasicOutputField
  - - org.encog.util.normalize.output.mapped.OutputFieldEncode

- All Implemented Interfaces:
    Serializable, OutputField

      public class OutputFieldEncode
      extends BasicOutputField

  An encoded output field. This allows ranges of output values to be mapped to specific values.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OutputFieldEncode(InputField sourceField)` Construct an encoded field.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRange(double low, double high, double value)` Add a ranged mapped to a value.
    `double` | `calculate(int subfield)` Calculate the value for this field.
    `double` | `getCatchAll()`
    `InputField` | `getSourceField()`
    `int` | `getSubfieldCount()`
    `void` | `rowInit()` Not needed for this sort of output field.
    `void` | `setCatchAll(double catchAll)` Set the catch all value.

    - ### Methods inherited from class org.encog.util.normalize.output.BasicOutputField

      `isIdeal, setIdeal`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### OutputFieldEncode

          public OutputFieldEncode(InputField sourceField)

      Construct an encoded field.
      Parameters:
        `sourceField` - The field that this is based on.

  - ### Method Detail

    - #### addRange

          public void addRange(double low,
                      double high,
                      double value)

      Add a ranged mapped to a value.
      Parameters:
        `low` - The low value for the range.
        `high` - The high value for the range.
        `value` - The value that the field should produce for this range.

    - #### calculate

          public double calculate(int subfield)

      Calculate the value for this field.
      Parameters:
        `subfield` - Not used.
      Returns:
        Return the value for the range the input falls within, or return the catchall if nothing matches.

    - #### getCatchAll

          public double getCatchAll()

      Returns:
        The catch all value that will be returned if nothing matches.

    - #### getSourceField

          public InputField getSourceField()

      Returns:
        The source field.

    - #### getSubfieldCount

          public int getSubfieldCount()

      Returns:
        Return 1, no subfield supported.

    - #### rowInit

          public void rowInit()

      Not needed for this sort of output field.

    - #### setCatchAll

          public void setCatchAll(double catchAll)

      Set the catch all value.
      Parameters:
        `catchAll` - The catch all value that is to be returned if none of the ranges match.

Copyright © 2014. All Rights Reserved.