Package com.cupoftea.table
Class Row
java.lang.Object
com.cupoftea.table.Row
- All Implemented Interfaces:
Serializable,Map<String,Object>
An immutable representation of a single DataFrame row with typed accessor methods.
Implements Map<String, Object> as an unmodifiable map so callers cannot
corrupt the internal schema or values directly.
Supports both map-backed rows and zero-copy columnar vector views for high-throughput sequential and parallel evaluation.
- See Also:
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsKey(String column) Checks if the column exists in this row.booleancontainsValue(Object value) entrySet()booleanget(int index) Untyped column accessor by integer position.Untyped column accessor by name.<T> TReturns the column value at the specified index cast to the requested type.<T> TReturns the column value cast or converted to the requested type.getBigDecimal(int index) Returns the column value at the specified index as a BigDecimal.getBigDecimal(String column) Returns the column value as a BigDecimal.getBoolean(int index) Returns the column value at the specified index as a Boolean.getBoolean(String column) Returns the column value as a Boolean.intgetCode(int index) Returns the dictionary code for the dictionary-encoded column at the given index, or-1if null/NA.intReturns the dictionary code for a dictionary-encoded column in this row, or-1if null/NA.getColumnName(int index) Resolves the column name at the given 0-based index.Returns the ordered list of column names present in this row.Returns the set of column names present in this row.getDate(int index) Returns the column value at the specified index as a Date.Returns the column value as a Date.getDouble(int index) Returns the column value at the specified index as a Double.Returns the column value as a Double.getFloat(int index) Returns the column value at the specified index as a Float.Returns the column value as a Float.getInstant(int index) Returns the column value at the specified index as an Instant.getInstant(String column) Returns the column value as an Instant.getInt(int index) Returns the column value at the specified index as an Integer.Returns the column value as an Integer.getInteger(int index) Returns the column value at the specified index as an Integer.getInteger(String column) Returns the column value as an Integer.getLocalDate(int index) Returns the column value at the specified index as a LocalDate.getLocalDate(String column) Returns the column value as a LocalDate.getLocalDateTime(int index) Returns the column value at the specified index as a LocalDateTime.getLocalDateTime(String column) Returns the column value as a LocalDateTime.getLong(int index) Returns the column value at the specified index as a Long.Returns the column value as a Long.getString(int index) Returns the column value at the specified index as a String.Returns the column value as a String.inthashCode()booleanisEmpty()booleanisMissing(int index) Alias forisNA(int).booleanAlias forisNA(String).booleanisNA(int index) Checks if the value at the given column position is missing / NA.booleanChecks if the value for the given column is missing / NA (null, NA singleton, or NaN).booleanisNull(int index) Checks if the value at the given column position is null.booleanChecks if the value for the given column is null.keySet()static Rowvoidintsize()toMap()Returns an unmodifiable shallow copy of the row as aMap.toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
Row
public Row() -
Row
-
Row
public Row(ColumnVector[] vectors, Map<String, Integer> columnIndex, List<String> columnOrder, int rowIndex) Zero-copy columnar constructor backed directly byColumnVectorinstances atrowIndex. Avoids allocating aLinkedHashMapper row during vectorized filter, map, and column creation.
-
-
Method Details
-
of
-
getColumnName
Resolves the column name at the given 0-based index. Supports negative index (-1 refers to the last column). -
get
Untyped column accessor by name.- Parameters:
column- column name- Returns:
- raw value or
null
-
get
-
get
Untyped column accessor by integer position. Supports negative indexing (-1 is the last column). -
isNA
Checks if the value for the given column is missing / NA (null, NA singleton, or NaN). -
isNull
Checks if the value for the given column is null. -
isMissing
Alias forisNA(String). -
isNA
public boolean isNA(int index) Checks if the value at the given column position is missing / NA. -
isNull
public boolean isNull(int index) Checks if the value at the given column position is null. -
isMissing
public boolean isMissing(int index) Alias forisNA(int). -
getString
Returns the column value as a String. If the value is not a String,Object.toString()is called unless null or NA. -
getString
Returns the column value at the specified index as a String. -
getCode
Returns the dictionary code for a dictionary-encoded column in this row, or-1if null/NA. -
getCode
public int getCode(int index) Returns the dictionary code for the dictionary-encoded column at the given index, or-1if null/NA. -
getInt
Returns the column value as an Integer. -
getInt
Returns the column value at the specified index as an Integer. -
getInteger
Returns the column value as an Integer. -
getInteger
Returns the column value at the specified index as an Integer. -
getLong
Returns the column value as a Long. -
getLong
Returns the column value at the specified index as a Long. -
getDouble
Returns the column value as a Double. -
getDouble
Returns the column value at the specified index as a Double. -
getFloat
Returns the column value as a Float. -
getFloat
Returns the column value at the specified index as a Float. -
getBoolean
Returns the column value as a Boolean. -
getBoolean
Returns the column value at the specified index as a Boolean. -
getDate
Returns the column value as a Date. -
getDate
Returns the column value at the specified index as a Date. -
getLocalDate
Returns the column value as a LocalDate. -
getLocalDate
Returns the column value at the specified index as a LocalDate. -
getLocalDateTime
Returns the column value as a LocalDateTime. -
getLocalDateTime
Returns the column value at the specified index as a LocalDateTime. -
getInstant
Returns the column value as an Instant. -
getInstant
Returns the column value at the specified index as an Instant. -
getBigDecimal
Returns the column value as a BigDecimal. -
getBigDecimal
Returns the column value at the specified index as a BigDecimal. -
getAs
Returns the column value cast or converted to the requested type. -
getAs
Returns the column value at the specified index cast to the requested type. -
containsKey
Checks if the column exists in this row. -
getColumns
Returns the set of column names present in this row. -
getColumnNames
Returns the ordered list of column names present in this row. -
toMap
Returns an unmodifiable shallow copy of the row as aMap. -
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object>
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode() -
toString
-