Class StandaloneReadableTuple

java.lang.Object
com.linkedin.feathr.common.tensor.StandaloneReadableTuple
All Implemented Interfaces:
ReadableTuple

public class StandaloneReadableTuple extends Object implements ReadableTuple
A readable tuple implementation that stores single tensor row data independent of a tensor aka in standalone manner. This implements equality and hashcode methods so it can be used as a key in maps
  • Constructor Details

    • StandaloneReadableTuple

      public StandaloneReadableTuple(StandaloneReadableTuple standaloneReadableTuple)
      Copies StandaloneReadableTuple. It shares all the underlying data.
      Parameters:
      standaloneReadableTuple - StandaloneReadableTuple to make copy of
    • StandaloneReadableTuple

      public StandaloneReadableTuple(ReadableTuple readableTuple)
    • StandaloneReadableTuple

      public StandaloneReadableTuple(ReadableTuple readableTuple, boolean dimOnly)
      Creates a StandaloneReadableTuple from a ReadableTuple optionally by dropping last value (float/double) columns. Note: this copies all the values from readableTuple so doesn't depend on underlying tensor, if any.
      Parameters:
      readableTuple - ReadableTuple to convert into StandaloneReadableTuple
      dimOnly - value column(s) won't be copied if true, all columns will be copied otherwise.
  • Method Details

    • getTypes

      public Representable[] getTypes()
      Specified by:
      getTypes in interface ReadableTuple
    • getInt

      public int getInt(int column)
      Specified by:
      getInt in interface ReadableTuple
      Returns:
      an int at given column.
    • getLong

      public long getLong(int column)
      Specified by:
      getLong in interface ReadableTuple
      Returns:
      a long at given column.
    • getFloat

      public float getFloat(int column)
      Specified by:
      getFloat in interface ReadableTuple
      Returns:
      a float at given column.
    • getDouble

      public double getDouble(int column)
      Specified by:
      getDouble in interface ReadableTuple
      Returns:
      a double at given column.
    • getBoolean

      public boolean getBoolean(int column)
      Specified by:
      getBoolean in interface ReadableTuple
      Returns:
      a boolean at given column.
    • getString

      public String getString(int column)
      Specified by:
      getString in interface ReadableTuple
      Returns:
      a string at given column.
    • getBytes

      public byte[] getBytes(int column)
      Specified by:
      getBytes in interface ReadableTuple
      Returns:
      a byte array at given column.
    • getCopy

      public ReadableTuple getCopy()
      Specified by:
      getCopy in interface ReadableTuple
      Returns:
      a copy of this tuple, so that changes to the original tuple will not affect the new one.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object