InputType
- The input type to convert encode into a number, which is then adapted
to be used in a Vector
.public class NumberConverterToVectorAdapter<InputType> extends AbstractToVectorEncoder<InputType>
DataConverter
that outputs a number to be a
VectorEncoder
.Modifier and Type | Field and Description |
---|---|
protected DataConverter<? super InputType,? extends java.lang.Number> |
converter
The converter to adapt for use with
Vector s. |
vectorFactory
Constructor and Description |
---|
NumberConverterToVectorAdapter()
Creates a new
NumberConverterToVectorAdapter . |
NumberConverterToVectorAdapter(DataConverter<? super InputType,? extends java.lang.Number> converter)
Creates a new
NumberConverterToVectorAdapter for the given
converter. |
Modifier and Type | Method and Description |
---|---|
void |
encode(InputType object,
Vector vector,
int index)
Encodes the given object into the vector at the given index by using the
number converter that this object is adapting.
|
DataConverter<? super InputType,? extends java.lang.Number> |
getConverter()
Gets the number converter being adapted to work with vectors.
|
int |
getOutputDimensionality()
Gets the dimensionality of this encoder, which is 1.
|
void |
setConverter(DataConverter<? super InputType,? extends java.lang.Number> converter)
Sets the number converter being adapted to work with vectors.
|
encode, evaluate, getVectorFactory, setVectorFactory
clone
protected DataConverter<? super InputType,? extends java.lang.Number> converter
Vector
s.public NumberConverterToVectorAdapter()
NumberConverterToVectorAdapter
.public NumberConverterToVectorAdapter(DataConverter<? super InputType,? extends java.lang.Number> converter)
NumberConverterToVectorAdapter
for the given
converter.converter
- The converter to adapt.public void encode(InputType object, Vector vector, int index)
object
- The input object to encode.vector
- The vector to encode into.index
- The index to encode at.public int getOutputDimensionality()
public DataConverter<? super InputType,? extends java.lang.Number> getConverter()
public void setConverter(DataConverter<? super InputType,? extends java.lang.Number> converter)
converter
- The adapted converter.