Interface Index<T extends Element>

  • Type Parameters:
    T - Element class

    public interface Index<T extends Element>
    An index is associated with each table and keeps track of each unique value in columns.

    Each column is associated with a @{ColumnIndex}.

    • Method Detail

      • count

        int count​(Column column,
                  Object value)
        Counts the elements with value in the given column.
        Parameters:
        column - the column to count values
        value - the value
        Returns:
        the number of elements in the index with value in column, or zero if none
      • get

        Iterable<T> get​(Column column,
                        Object value)
        Gets an Iterable of all elements in the index with value in the given column.
        Parameters:
        column - the column to get values
        value - the value
        Returns:
        an iterable with element with value in column, or null if value not found
      • values

        Collection values​(Column column)
        Returns all unique values in the given column.
        Parameters:
        column - the column to get values from
        Returns:
        a collection of all unique values
      • countValues

        int countValues​(Column column)
        Counts the unique values in the given column.
        Parameters:
        column - the column to count values
        Returns:
        the number of distinct values in column
      • countElements

        int countElements​(Column column)
        Counts the elements in the given column.
        Parameters:
        column - the column to count elements
        Returns:
        the number of elements in column
      • getMinValue

        Number getMinValue​(Column column)
        Returns the minimum value in the given column.

        Only applies for numerical columns.

        Parameters:
        column - the column
        Returns:
        the minimum value in the column
      • getMaxValue

        Number getMaxValue​(Column column)
        Returns the maximum value in the given column.

        Only applies for numerical columns.

        Parameters:
        column - the column
        Returns:
        the maximum value in the column
      • getIndexClass

        Class<T> getIndexClass()
        Returns the element type of this index.
        Returns:
        the index element class
      • getIndexName

        String getIndexName()
        Returns the name of this index.
        Returns:
        the index name
      • getColumnIndex

        ColumnIndex getColumnIndex​(Column column)
        Returns the column index for the given column.
        Parameters:
        column - the column to get the index for
        Returns:
        the column index