Package org.openrefine.model
Class RowInRecordMapper
- java.lang.Object
-
- org.openrefine.model.RowInRecordMapper
-
- All Implemented Interfaces:
Serializable,RecordMapper,RowMapper
- Direct Known Subclasses:
ExpressionBasedOperation.NegativeRowMapper,ExpressionBasedOperation.PositiveRowMapper
public abstract class RowInRecordMapper extends Object implements RowMapper, RecordMapper
LikeRowMapperexcept that the enclosingRecordis also available. This defines aRecordMapperwhich maps each row accordingly. When used as aRowMapper, the record argument is set to null. This class is useful when performing a row-wise operation in records mode, as the enclosing record must be available in the expression language.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static RowInRecordMapperIDENTITY
-
Constructor Summary
Constructors Constructor Description RowInRecordMapper()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Rowcall(long rowId, Row row)List<Row>call(Record record)Maps a record to a list of rows.abstract Rowcall(Record record, long rowId, Row row)Maps a row, in the context of a record.static RowInRecordMapperfromRowMapper(RowMapper rowMapper)abstract booleanpreservesRecordStructure()Is this mapper guaranteed to preserve the records structure, both as a record mapper and a row mapper?booleanpreservesRowCount()If every record is mapped to a list with the same number of rows as what the record contains, set this boolean to true.
-
-
-
Field Detail
-
IDENTITY
public static final RowInRecordMapper IDENTITY
-
-
Method Detail
-
call
public abstract Row call(Record record, long rowId, Row row)
Maps a row, in the context of a record.- Parameters:
record- the record enclosing the row to maprowId- the global index of the row in the entire gridrow- the row itself
-
preservesRecordStructure
public abstract boolean preservesRecordStructure()
Is this mapper guaranteed to preserve the records structure, both as a record mapper and a row mapper?- Specified by:
preservesRecordStructurein interfaceRecordMapper- Specified by:
preservesRecordStructurein interfaceRowMapper
-
call
public List<Row> call(Record record)
Description copied from interface:RecordMapperMaps a record to a list of rows. The rows may not form a single record, unlessRecordMapper.preservesRecordStructure()istrue.- Specified by:
callin interfaceRecordMapper
-
preservesRowCount
public boolean preservesRowCount()
Description copied from interface:RecordMapperIf every record is mapped to a list with the same number of rows as what the record contains, set this boolean to true. This helps the underlying implementation avoid recomputing row ids.- Specified by:
preservesRowCountin interfaceRecordMapper
-
fromRowMapper
public static RowInRecordMapper fromRowMapper(RowMapper rowMapper)
-
-