Class Table.Sequence

java.lang.Object
edu.uky.ai.util.Table.Sequence
All Implemented Interfaces:
Iterable<Table.Cell>
Direct Known Subclasses:
Table.Column, Table.Row
Enclosing class:
Table

public abstract static class Table.Sequence extends Object implements Iterable<Table.Cell>
The abstract parent of Table.Row and Table.Column.
Author:
Stephen G. Ware
  • Field Details

    • table

      public final Table table
      The table this sequence belongs to
    • number

      public final int number
      The row or column number of this sequence
    • label

      public final Object label
      The row or column lable of this sequence
    • cells

      public final ImmutableArray<Table.Cell> cells
      The cells that make up this row or column
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • iterator

      public Iterator<Table.Cell> iterator()
      Specified by:
      iterator in interface Iterable<Table.Cell>
    • sum

      public Number sum(Function<Object,?> function)
      Returns the sum of the numeric elements of this sequence (non-numeric values are ignored).
      Parameters:
      function - a function for converting the values of the cells in this sequence to Numbers that will be applied to each cell value before adding it to the sum
      Returns:
      the sum of the cell values
    • sum

      public Number sum()
      Returns the sum of the numeric elements of this sequence (non-numeric values are ignored).
      Returns:
      the sum of the cell values
    • average

      public Number average(Function<Object,?> function)
      Returns the average of the numeric elements of this sequence (non-numeric values are ignored).
      Parameters:
      function - a function for converting the values of the cells in this sequence to Numbers that will be applied to each cell value before including it in the average
      Returns:
      the average of the cell values
    • average

      public Number average()
      Returns the average of the numeric elements of this sequence (non-numeric values are ignored).
      Returns:
      the average of the cell values