Class SimpleWriteableTuple<T extends WriteableTuple<T>>
java.lang.Object
com.linkedin.feathr.common.ColumnUtils
com.linkedin.feathr.common.tensor.SimpleWriteableTuple<T>
- Type Parameters:
T-
- All Implemented Interfaces:
ReadableTuple,WriteableTuple<T>
public class SimpleWriteableTuple<T extends WriteableTuple<T>>
extends ColumnUtils
implements WriteableTuple<T>, ReadableTuple
An implementation of
WriteableTuple which keeps all values in primitive arrays.
This can be used as a scratch space for a single row in a tensor.-
Field Summary
Fields inherited from class com.linkedin.feathr.common.ColumnUtils
_booleanArity, _bytesArity, _columnIndex, _columnTypes, _doubleArity, _floatArity, _intArity, _longArity, _stringArity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleangetBoolean(int column) byte[]getBytes(int column) getCopy()doublegetDouble(int column) floatgetFloat(int column) intgetInt(int column) longgetLong(int column) getString(int column) getTypes()inthashCode()voidResets all values to 0 (for primitives) and null for StringssetBoolean(int column, boolean value) Sets the specified column to a given `boolean`setBytes(int column, byte[] value) Sets the specified column to a given `byte array`setDouble(int column, double value) Sets the specified column to a given `double`setFloat(int column, float value) Sets the specified column to a given `float`setInt(int column, int value) Sets the specified column to a given `int`setLong(int column, long value) Sets the specified column to a given `long`Sets the specified column to a given `String`Methods inherited from class com.linkedin.feathr.common.ColumnUtils
getBooleanArity, getBytesArity, getColumnIndex, getColumnTypes, getDimArity, getDoubleArity, getFloatArity, getIntArity, getLongArity, getStringArityMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linkedin.feathr.common.tensor.WriteableTuple
setValue
-
Constructor Details
-
SimpleWriteableTuple
-
-
Method Details
-
getTypes
- Specified by:
getTypesin interfaceReadableTuple- Specified by:
getTypesin interfaceWriteableTuple<T extends WriteableTuple<T>>- Returns:
- the types of all dimensions and the value as a single array.
-
getInt
public int getInt(int column) - Specified by:
getIntin interfaceReadableTuple- Returns:
- an int at given column.
-
getLong
public long getLong(int column) - Specified by:
getLongin interfaceReadableTuple- Returns:
- a long at given column.
-
getFloat
public float getFloat(int column) - Specified by:
getFloatin interfaceReadableTuple- Returns:
- a float at given column.
-
getDouble
public double getDouble(int column) - Specified by:
getDoublein interfaceReadableTuple- Returns:
- a double at given column.
-
getBoolean
public boolean getBoolean(int column) - Specified by:
getBooleanin interfaceReadableTuple- Returns:
- a boolean at given column.
-
getString
- Specified by:
getStringin interfaceReadableTuple- Returns:
- a string at given column.
-
getBytes
public byte[] getBytes(int column) - Specified by:
getBytesin interfaceReadableTuple- Returns:
- a byte array at given column.
-
getCopy
- Specified by:
getCopyin interfaceReadableTuple- Returns:
- a copy of this tuple, so that changes to the original tuple will not affect the new one.
-
setInt
Description copied from interface:WriteableTupleSets the specified column to a given `int`- Specified by:
setIntin interfaceWriteableTuple<T extends WriteableTuple<T>>- Parameters:
column- The column in the tuple to write tovalue- The int value to be written- Returns:
- A reference to this object (`this`)
-
setLong
Description copied from interface:WriteableTupleSets the specified column to a given `long`- Specified by:
setLongin interfaceWriteableTuple<T extends WriteableTuple<T>>- Parameters:
column- The column in the tuple to write tovalue- The long value to be written- Returns:
- A reference to this object (`this`)
-
setFloat
Description copied from interface:WriteableTupleSets the specified column to a given `float`- Specified by:
setFloatin interfaceWriteableTuple<T extends WriteableTuple<T>>- Parameters:
column- The column in the tuple to write tovalue- The float value to be written- Returns:
- A reference to this object (`this`)
-
setDouble
Description copied from interface:WriteableTupleSets the specified column to a given `double`- Specified by:
setDoublein interfaceWriteableTuple<T extends WriteableTuple<T>>- Parameters:
column- The column in the tuple to write tovalue- The double value to be written- Returns:
- A reference to this object (`this`)
-
setBoolean
Description copied from interface:WriteableTupleSets the specified column to a given `boolean`- Specified by:
setBooleanin interfaceWriteableTuple<T extends WriteableTuple<T>>- Parameters:
column- The column in the tuple to write tovalue- The double value to be written- Returns:
- A reference to this object (`this`)
-
setString
Description copied from interface:WriteableTupleSets the specified column to a given `String`- Specified by:
setStringin interfaceWriteableTuple<T extends WriteableTuple<T>>- Parameters:
column- The column in the tuple to write tovalue- The String value to be written- Returns:
- A reference to this object (`this`)
-
setBytes
Description copied from interface:WriteableTupleSets the specified column to a given `byte array`- Specified by:
setBytesin interfaceWriteableTuple<T extends WriteableTuple<T>>- Parameters:
column- The column in the tuple to write tovalue- The byte array value to be written- Returns:
- A reference to this object (`this`)
-
resetColumns
public void resetColumns()Resets all values to 0 (for primitives) and null for Strings -
equals
-
hashCode
public int hashCode()
-