gov.sandia.cognition.text.convert
Class SingleToMultiTextualConverterAdapter<InputType,OutputType extends Textual>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.text.convert.AbstractTextualConverter<InputType,OutputType>
          extended by gov.sandia.cognition.text.convert.AbstractMultiTextualConverter<InputType,OutputType>
              extended by gov.sandia.cognition.text.convert.SingleToMultiTextualConverterAdapter<InputType,OutputType>
Type Parameters:
InputType - The type of input that can be converted to a textual form.
OutputType - The type of textual output of the converter. Must implement the Textual interface.
All Implemented Interfaces:
DataConverter<InputType,Iterable<OutputType>>, Evaluator<InputType,Iterable<OutputType>>, MultiTextualConverter<InputType,OutputType>, TextualConverter<InputType,OutputType>, CloneableSerializable, Serializable, Cloneable

public class SingleToMultiTextualConverterAdapter<InputType,OutputType extends Textual>
extends AbstractMultiTextualConverter<InputType,OutputType>

Adapts a SingleTextualConverter to work within the interface of an MultiTextualConverter.

Since:
3.1
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  SingleTextualConverter<? super InputType,? extends OutputType> converter
          The single text converter being wrapped.
 
Constructor Summary
SingleToMultiTextualConverterAdapter()
          Creates a new SingleToMultiTextualConverterAdapter with no internal converter.
SingleToMultiTextualConverterAdapter(SingleTextualConverter<? super InputType,? extends OutputType> converter)
          Creates a new SingleToMultiTextualConverterAdapter with the given internal converter.
 
Method Summary
 Iterable<OutputType> evaluate(InputType input)
          Evaluates the function on the given input and returns the output.
 SingleTextualConverter<? super InputType,? extends OutputType> getConverter()
          Gets the internal single textual converter being wrapped.
 void setConverter(SingleTextualConverter<? super InputType,? extends OutputType> converter)
          Sets the internal single textual converter being wrapped.
 
Methods inherited from class gov.sandia.cognition.text.convert.AbstractMultiTextualConverter
convert, convertAll
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

converter

protected SingleTextualConverter<? super InputType,? extends OutputType extends Textual> converter
The single text converter being wrapped.

Constructor Detail

SingleToMultiTextualConverterAdapter

public SingleToMultiTextualConverterAdapter()
Creates a new SingleToMultiTextualConverterAdapter with no internal converter.


SingleToMultiTextualConverterAdapter

public SingleToMultiTextualConverterAdapter(SingleTextualConverter<? super InputType,? extends OutputType> converter)
Creates a new SingleToMultiTextualConverterAdapter with the given internal converter.

Parameters:
converter - The internal converter.
Method Detail

evaluate

public Iterable<OutputType> evaluate(InputType input)
Description copied from interface: Evaluator
Evaluates the function on the given input and returns the output.

Parameters:
input - The input to evaluate.
Returns:
The output produced by evaluating the input.

getConverter

public SingleTextualConverter<? super InputType,? extends OutputType> getConverter()
Gets the internal single textual converter being wrapped.

Returns:
The internal single textual converter.

setConverter

public void setConverter(SingleTextualConverter<? super InputType,? extends OutputType> converter)
Sets the internal single textual converter being wrapped.

Parameters:
converter - The internal single textual converter.