Class Table.Sequence

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

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

    Fields 
    Modifier and Type Field Description
    ImmutableArray<Table.Cell> cells
    The cells that make up this row or column
    java.lang.Object label
    The row or column lable of this sequence
    int number
    The row or column number of this sequence
    Table table
    The table this sequence belongs to
  • Method Summary

    Modifier and Type Method Description
    java.lang.Number average()
    Returns the average of the numeric elements of this sequence (non-numeric values are ignored).
    java.lang.Number average​(java.util.function.Function<java.lang.Object,​?> function)
    Returns the average of the numeric elements of this sequence (non-numeric values are ignored).
    int hashCode()  
    java.util.Iterator<Table.Cell> iterator()  
    java.lang.Number sum()
    Returns the sum of the numeric elements of this sequence (non-numeric values are ignored).
    java.lang.Number sum​(java.util.function.Function<java.lang.Object,​?> function)
    Returns the sum of the numeric elements of this sequence (non-numeric values are ignored).

    Methods inherited from class java.lang.Object

    equals, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • 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 java.lang.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 java.lang.Object
    • iterator

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

      public java.lang.Number sum​(java.util.function.Function<java.lang.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 java.lang.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 java.lang.Number average​(java.util.function.Function<java.lang.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 java.lang.Number average()
      Returns the average of the numeric elements of this sequence (non-numeric values are ignored).
      Returns:
      the average of the cell values