Class Row

java.lang.Object
com.cupoftea.table.Row
All Implemented Interfaces:
Serializable, Map<String,Object>

public class Row extends Object implements Map<String,Object>, Serializable
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:
  • Constructor Details

  • Method Details

    • of

      public static Row of(Object... keyValues)
    • getColumnName

      public String getColumnName(int index)
      Resolves the column name at the given 0-based index. Supports negative index (-1 refers to the last column).
    • get

      public Object get(String column)
      Untyped column accessor by name.
      Parameters:
      column - column name
      Returns:
      raw value or null
    • get

      public Object get(Object key)
      Specified by:
      get in interface Map<String,Object>
    • get

      public Object get(int index)
      Untyped column accessor by integer position. Supports negative indexing (-1 is the last column).
    • isNA

      public boolean isNA(String column)
      Checks if the value for the given column is missing / NA (null, NA singleton, or NaN).
    • isNull

      public boolean isNull(String column)
      Checks if the value for the given column is null.
    • isMissing

      public boolean isMissing(String column)
      Alias for isNA(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 for isNA(int).
    • getString

      public String getString(String column)
      Returns the column value as a String. If the value is not a String, Object.toString() is called unless null or NA.
    • getString

      public String getString(int index)
      Returns the column value at the specified index as a String.
    • getCode

      public int getCode(String column)
      Returns the dictionary code for a dictionary-encoded column in this row, or -1 if null/NA.
    • getCode

      public int getCode(int index)
      Returns the dictionary code for the dictionary-encoded column at the given index, or -1 if null/NA.
    • getInt

      public Integer getInt(String column)
      Returns the column value as an Integer.
    • getInt

      public Integer getInt(int index)
      Returns the column value at the specified index as an Integer.
    • getInteger

      public Integer getInteger(String column)
      Returns the column value as an Integer.
    • getInteger

      public Integer getInteger(int index)
      Returns the column value at the specified index as an Integer.
    • getLong

      public Long getLong(String column)
      Returns the column value as a Long.
    • getLong

      public Long getLong(int index)
      Returns the column value at the specified index as a Long.
    • getDouble

      public Double getDouble(String column)
      Returns the column value as a Double.
    • getDouble

      public Double getDouble(int index)
      Returns the column value at the specified index as a Double.
    • getFloat

      public Float getFloat(String column)
      Returns the column value as a Float.
    • getFloat

      public Float getFloat(int index)
      Returns the column value at the specified index as a Float.
    • getBoolean

      public Boolean getBoolean(String column)
      Returns the column value as a Boolean.
    • getBoolean

      public Boolean getBoolean(int index)
      Returns the column value at the specified index as a Boolean.
    • getDate

      public Date getDate(String column)
      Returns the column value as a Date.
    • getDate

      public Date getDate(int index)
      Returns the column value at the specified index as a Date.
    • getLocalDate

      public LocalDate getLocalDate(String column)
      Returns the column value as a LocalDate.
    • getLocalDate

      public LocalDate getLocalDate(int index)
      Returns the column value at the specified index as a LocalDate.
    • getLocalDateTime

      public LocalDateTime getLocalDateTime(String column)
      Returns the column value as a LocalDateTime.
    • getLocalDateTime

      public LocalDateTime getLocalDateTime(int index)
      Returns the column value at the specified index as a LocalDateTime.
    • getInstant

      public Instant getInstant(String column)
      Returns the column value as an Instant.
    • getInstant

      public Instant getInstant(int index)
      Returns the column value at the specified index as an Instant.
    • getBigDecimal

      public BigDecimal getBigDecimal(String column)
      Returns the column value as a BigDecimal.
    • getBigDecimal

      public BigDecimal getBigDecimal(int index)
      Returns the column value at the specified index as a BigDecimal.
    • getAs

      public <T> T getAs(String column, Class<T> type)
      Returns the column value cast or converted to the requested type.
    • getAs

      public <T> T getAs(int index, Class<T> type)
      Returns the column value at the specified index cast to the requested type.
    • containsKey

      public boolean containsKey(String column)
      Checks if the column exists in this row.
    • getColumns

      public Set<String> getColumns()
      Returns the set of column names present in this row.
    • getColumnNames

      public List<String> getColumnNames()
      Returns the ordered list of column names present in this row.
    • toMap

      public Map<String,Object> toMap()
      Returns an unmodifiable shallow copy of the row as a Map.
    • size

      public int size()
      Specified by:
      size in interface Map<String,Object>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<String,Object>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<String,Object>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<String,Object>
    • put

      public Object put(String key, Object value)
      Specified by:
      put in interface Map<String,Object>
    • remove

      public Object remove(Object key)
      Specified by:
      remove in interface Map<String,Object>
    • putAll

      public void putAll(Map<? extends String,?> m)
      Specified by:
      putAll in interface Map<String,Object>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<String,Object>
    • keySet

      public Set<String> keySet()
      Specified by:
      keySet in interface Map<String,Object>
    • values

      public Collection<Object> values()
      Specified by:
      values in interface Map<String,Object>
    • entrySet

      public Set<Map.Entry<String,Object>> entrySet()
      Specified by:
      entrySet in interface Map<String,Object>
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map<String,Object>
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map<String,Object>
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object