InputType
- The type of input data to be encoded into a Vector
.public abstract class AbstractToVectorEncoder<InputType> extends AbstractDataConverter<InputType,Vector> implements DataToVectorEncoder<InputType>, VectorFactoryContainer
DataToVectorEncoder
interface. It
chains together the typical calls to create a vector and allows a vector
factory to be stored on the encoder.Modifier and Type | Field and Description |
---|---|
protected VectorFactory<?> |
vectorFactory
The vector factory to use to create new vectors.
|
Constructor and Description |
---|
AbstractToVectorEncoder()
Creates a new
AbstractToVectorEncoder . |
AbstractToVectorEncoder(VectorFactory<?> vectorFactory)
Creates a new
AbstractToVectorEncoder with the given vector
factory. |
Modifier and Type | Method and Description |
---|---|
void |
encode(InputType object,
Vector vector)
Encodes the given object into the given
Vector . |
Vector |
evaluate(InputType input)
Converts the given object to a
Vector . |
VectorFactory<?> |
getVectorFactory()
Gets the vector factory the object to use to create new vectors.
|
void |
setVectorFactory(VectorFactory<?> vectorFactory)
Sets the vector factory used by this encoder.
|
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
encode, getOutputDimensionality
protected VectorFactory<?> vectorFactory
public AbstractToVectorEncoder()
AbstractToVectorEncoder
.public AbstractToVectorEncoder(VectorFactory<?> vectorFactory)
AbstractToVectorEncoder
with the given vector
factory.vectorFactory
- The VectorFactory
to use.public void encode(InputType object, Vector vector)
DataToVectorEncoder
Vector
. It starts at
index zero in the Vector
.encode
in interface DataToVectorEncoder<InputType>
object
- The object to encode.vector
- The vector to encode the object into.public VectorFactory<?> getVectorFactory()
VectorFactoryContainer
getVectorFactory
in interface VectorFactoryContainer
public void setVectorFactory(VectorFactory<?> vectorFactory)
vectorFactory
- The vector factory to use.