Package org.openrefine.model
Class IndexedRow
- java.lang.Object
-
- org.openrefine.model.IndexedRow
-
- All Implemented Interfaces:
Serializable
public class IndexedRow extends Object implements Serializable
A row with its row index. Equivalent toTuple2<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 Summary
Constructors Constructor Description IndexedRow(long id, Long originalId, Row row)
IndexedRow(long id, Row row)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
long
getIndex()
The position (0-based) of the row in the grid.long
getLogicalIndex()
The original index of this row, or if it is not set, the actual one.Long
getOriginalIndex()
If this grid was obtained by applying a temporary sorting, this returns the original id of the row in the unsorted grid.Row
getRow()
The rowint
hashCode()
String
toString()
-
-
-
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.
-
-