Class IndexedRow

  • All Implemented Interfaces:

    public class IndexedRow
    extends Object
    implements Serializable
    A row with its row index. Equivalent to Tuple2<long, Row> but serializable and deserializable with Jackson easily. Serialization keys are kept short to reduce the memory overhead.

    This class can also hold a so-called original row id, which is used when sorting grids. The original row id is the original position of the row before sorting the grid. This is used when the user adds sorting settings in the UI without permanently re-ordering the rows yet.

    See Also:
    Serialized Form
    • Constructor Detail

      • IndexedRow

        public IndexedRow​(long id,
                          Row row)
      • IndexedRow

        public IndexedRow​(long id,
                          Long originalId,
                          Row row)
    • Method Detail

      • getIndex

        public long getIndex()
        The position (0-based) of the row in the grid.
      • getRow

        public Row getRow()
        The row
      • getOriginalIndex

        public Long getOriginalIndex()
        If this grid was obtained by applying a temporary sorting, this returns the original id of the row in the unsorted grid. Otherwise, this returns null.
      • getLogicalIndex

        public long getLogicalIndex()
        The original index of this row, or if it is not set, the actual one.
      • hashCode

        public int hashCode()
        hashCode in class Object