gov.sandia.cognition.data.convert.vector
Class NumberToVectorEncoder

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.data.convert.AbstractDataConverter<InputType,Vector>
          extended by gov.sandia.cognition.data.convert.vector.AbstractToVectorEncoder<Number>
              extended by gov.sandia.cognition.data.convert.vector.NumberToVectorEncoder
All Implemented Interfaces:
DataConverter<Number,Vector>, DataToVectorEncoder<Number>, Evaluator<Number,Vector>, VectorOutputEvaluator<Number,Vector>, CloneableSerializable, Serializable, Cloneable

public class NumberToVectorEncoder
extends AbstractToVectorEncoder<Number>

An encoder that encodes a number as an element of a Vector.

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

Field Summary
 
Fields inherited from class gov.sandia.cognition.data.convert.vector.AbstractToVectorEncoder
vectorFactory
 
Constructor Summary
NumberToVectorEncoder()
          Creates a new NumberToVectorEncoder.
 
Method Summary
 void encode(Number number, Vector vector, int index)
          Encodes the given number into the given vector at the given index.
 int getOutputDimensionality()
          Gets the dimensionality of the converter, which is 1.
 
Methods inherited from class gov.sandia.cognition.data.convert.vector.AbstractToVectorEncoder
encode, evaluate
 
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
 

Constructor Detail

NumberToVectorEncoder

public NumberToVectorEncoder()
Creates a new NumberToVectorEncoder.

Method Detail

encode

public void encode(Number number,
                   Vector vector,
                   int index)
Encodes the given number into the given vector at the given index.

Parameters:
number - The number to encode.
vector - The vector to encode into.
index - The index to encode at.

getOutputDimensionality

public int getOutputDimensionality()
Gets the dimensionality of the converter, which is 1.

Returns:
The dimensionality of the converter.