gov.sandia.cognition.framework.learning.converter
Class CogxelInputOutputPairConverter<InputType,OutputType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.framework.learning.converter.AbstractCogxelConverter<PairType>
          extended by gov.sandia.cognition.framework.learning.converter.AbstractCogxelPairConverter<InputType,OutputType,InputOutputPair<InputType,OutputType>>
              extended by gov.sandia.cognition.framework.learning.converter.CogxelInputOutputPairConverter<InputType,OutputType>
Type Parameters:
InputType - Type of input to convert into the inputs of the InputOutputPairs
OutputType - Type of outputs to convert into the outputs of the InputOutputPairs
All Implemented Interfaces:
CogxelConverter<InputOutputPair<InputType,OutputType>>, CloneableSerializable, Serializable, Cloneable

public class CogxelInputOutputPairConverter<InputType,OutputType>
extends AbstractCogxelPairConverter<InputType,OutputType,InputOutputPair<InputType,OutputType>>
implements CogxelConverter<InputOutputPair<InputType,OutputType>>

The InputOutputPairCogxelConverter class implements a converter to and from Cogxels to InputOutputPair objects. This is done by specifying two sub converters: one for the input type and one for the output type.

Since:
2.0
Author:
Justin Basilico, Kevin R. Dixon
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.framework.learning.converter.AbstractCogxelConverter
semanticIdentifierMap
 
Constructor Summary
CogxelInputOutputPairConverter()
          Default constructor
CogxelInputOutputPairConverter(CogxelConverter<InputType> inputConverter, CogxelConverter<OutputType> outputConverter)
          Creates a new instance of InputOutputCogxelConverter.
CogxelInputOutputPairConverter(CogxelConverter<InputType> inputConverter, CogxelConverter<OutputType> outputConverter, SemanticIdentifierMap semanticIdentifierMap)
          Creates a new instance of InputOutputCogxelConverter.
 
Method Summary
 InputOutputPair<InputType,OutputType> createPair(InputType first, OutputType second)
          Creates a Pair from the needed data
 boolean equals(Object other)
           
 CogxelConverter<InputType> getInputConverter()
          Gets the input converter
 CogxelConverter<OutputType> getOutputConverter()
          Gets the output converter
 int hashCode()
           
 void setInputConverter(CogxelConverter<InputType> inputConverter)
          Sets the input converter
 void setOutputConverter(CogxelConverter<OutputType> outputConverter)
          Sets the output converter
 
Methods inherited from class gov.sandia.cognition.framework.learning.converter.AbstractCogxelPairConverter
clone, equals, fromCogxels, getFirstConverter, getSecondConverter, setFirstConverter, setSecondConverter, setSemanticIdentifierMap, toCogxels
 
Methods inherited from class gov.sandia.cognition.framework.learning.converter.AbstractCogxelConverter
buildIdentifierCache, getSemanticIdentifierMap
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.framework.learning.converter.CogxelConverter
clone, fromCogxels, getSemanticIdentifierMap, setSemanticIdentifierMap, toCogxels
 

Constructor Detail

CogxelInputOutputPairConverter

public CogxelInputOutputPairConverter()
Default constructor


CogxelInputOutputPairConverter

public CogxelInputOutputPairConverter(CogxelConverter<InputType> inputConverter,
                                      CogxelConverter<OutputType> outputConverter)
Creates a new instance of InputOutputCogxelConverter.

Parameters:
inputConverter - The CogxelConverter for the input element of the pair.
outputConverter - The CogxelConverter for the output element of the pair.

CogxelInputOutputPairConverter

public CogxelInputOutputPairConverter(CogxelConverter<InputType> inputConverter,
                                      CogxelConverter<OutputType> outputConverter,
                                      SemanticIdentifierMap semanticIdentifierMap)
Creates a new instance of InputOutputCogxelConverter.

Parameters:
inputConverter - The CogxelConverter for the input element of the pair.
outputConverter - The CogxelConverter for the output element of the pair.
semanticIdentifierMap - The SemanticIdentifierMap used by the converter.
Method Detail

equals

public boolean equals(Object other)
Overrides:
equals in class AbstractCogxelPairConverter<InputType,OutputType,InputOutputPair<InputType,OutputType>>

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractCogxelPairConverter<InputType,OutputType,InputOutputPair<InputType,OutputType>>

createPair

public InputOutputPair<InputType,OutputType> createPair(InputType first,
                                                        OutputType second)
Description copied from class: AbstractCogxelPairConverter
Creates a Pair from the needed data

Specified by:
createPair in class AbstractCogxelPairConverter<InputType,OutputType,InputOutputPair<InputType,OutputType>>
Parameters:
first - First element of the Pair
second - Second element of the Pair
Returns:
Pair with the given parameters

getInputConverter

public CogxelConverter<InputType> getInputConverter()
Gets the input converter

Returns:
Input converter

getOutputConverter

public CogxelConverter<OutputType> getOutputConverter()
Gets the output converter

Returns:
Output converter

setInputConverter

public void setInputConverter(CogxelConverter<InputType> inputConverter)
Sets the input converter

Parameters:
inputConverter - Input converter

setOutputConverter

public void setOutputConverter(CogxelConverter<OutputType> outputConverter)
Sets the output converter

Parameters:
outputConverter - Output converter