public final class UniversalTensorBuilder extends ColumnUtils implements TensorBuilder<UniversalTensorBuilder>
_booleanArity, _bytesArity, _columnIndex, _columnTypes, _doubleArity, _floatArity, _intArity, _longArity, _stringArity| Constructor and Description |
|---|
UniversalTensorBuilder(int valueArity,
Representable... columnTypes) |
UniversalTensorBuilder(Representable... columnTypes) |
| Modifier and Type | Method and Description |
|---|---|
UniversalTensorBuilder |
append()
Tells this TensorBuilder that the current row is complete.
|
TensorData |
build(boolean sort)
Build the tensor
|
Representable[] |
getOutputTypes() |
Representable[] |
getTypes() |
UniversalTensorBuilder |
setBoolean(int index,
boolean value)
Sets the specified column to a given `boolean`
|
UniversalTensorBuilder |
setBytes(int index,
byte[] value)
Sets the specified column to a given `byte array`
|
UniversalTensorBuilder |
setDouble(int index,
double value)
Sets the specified column to a given `double`
|
UniversalTensorBuilder |
setFloat(int index,
float value)
Sets the specified column to a given `float`
|
UniversalTensorBuilder |
setInt(int index,
int value)
Sets the specified column to a given `int`
|
UniversalTensorBuilder |
setLong(int index,
long value)
Sets the specified column to a given `long`
|
UniversalTensorBuilder |
setString(int index,
java.lang.String value)
Sets the specified column to a given `String`
|
UniversalTensorBuilder |
start(int estimatedRows)
Initializes this TensorBuilder.
|
getBooleanArity, getBytesArity, getColumnIndex, getColumnTypes, getDimArity, getDoubleArity, getFloatArity, getIntArity, getLongArity, getStringArityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuild, copyColumn, copyColumns, copyColumns, copyColumns, copyLeftColumns, startsetValuepublic UniversalTensorBuilder(Representable... columnTypes)
public UniversalTensorBuilder(int valueArity,
Representable... columnTypes)
public UniversalTensorBuilder start(int estimatedRows)
TensorBuilderTensorBuilder.start() MUST be called before setting values
to this TensorBuilder. This method may also be used to "reset" the builder, enabling it to be reused.start in interface TensorBuilder<UniversalTensorBuilder>estimatedRows - The estimated number of rows in this tensor. Implementations can use this to allocate internal
array sizes, for example.public UniversalTensorBuilder setInt(int index, int value)
WriteableTuplesetInt in interface WriteableTuple<UniversalTensorBuilder>index - The column in the tuple to write tovalue - The int value to be writtenpublic UniversalTensorBuilder setLong(int index, long value)
WriteableTuplesetLong in interface WriteableTuple<UniversalTensorBuilder>index - The column in the tuple to write tovalue - The long value to be writtenpublic UniversalTensorBuilder setString(int index, java.lang.String value)
WriteableTuplesetString in interface WriteableTuple<UniversalTensorBuilder>setString in interface TensorBuilder<UniversalTensorBuilder>index - The column in the tuple to write tovalue - The String value to be writtenpublic UniversalTensorBuilder setFloat(int index, float value)
WriteableTuplesetFloat in interface WriteableTuple<UniversalTensorBuilder>index - The column in the tuple to write tovalue - The float value to be writtenpublic UniversalTensorBuilder setDouble(int index, double value)
WriteableTuplesetDouble in interface WriteableTuple<UniversalTensorBuilder>setDouble in interface TensorBuilder<UniversalTensorBuilder>index - The column in the tuple to write tovalue - The double value to be writtenpublic UniversalTensorBuilder setBoolean(int index, boolean value)
WriteableTuplesetBoolean in interface WriteableTuple<UniversalTensorBuilder>setBoolean in interface TensorBuilder<UniversalTensorBuilder>index - The column in the tuple to write tovalue - The double value to be writtenpublic UniversalTensorBuilder setBytes(int index, byte[] value)
WriteableTuplesetBytes in interface WriteableTuple<UniversalTensorBuilder>index - The column in the tuple to write tovalue - The byte array value to be writtenpublic UniversalTensorBuilder append()
TensorBuilderWriteableTuple.setInt(int, int), WriteableTuple.setFloat(int, float), etc. to set all the columns of the current row.append in interface TensorBuilder<UniversalTensorBuilder>public Representable[] getTypes()
getTypes in interface WriteableTuple<UniversalTensorBuilder>public TensorData build(boolean sort)
TensorBuilderbuild in interface TensorBuilder<UniversalTensorBuilder>sort - if set to true, the built tensor's rows will be sorted lexicographicallypublic Representable[] getOutputTypes()
getOutputTypes in interface TypedOperator