Interface Group

All Known Implementing Classes:
GroupImpl

public interface Group
A group of rows. Group is build according to GroupDefinitions.
Author:
sasa
  • Method Details

    • toArray

      Object[] toArray()
      Groups elements as an array
      Returns:
      elements as an array
    • getGroup

      <T, R> R getGroup(GroupExpression<T,R> coldef)
      Returns the value of the given group.
      Type Parameters:
      T - Type of element in a single ResultSet row, i.e. type of Expression<T>
      R - Target type of this group, e.g. List<T>
      Parameters:
      coldef -
      Returns:
      Value of given group definition in this group
      Throws:
      NoSuchElementException - if group is undefined.
      ClassCastException - if group is of different type
    • getOne

      <T> T getOne(Expression<T> expr)
      Returns the value of the given single valued expression. This is the first value of given column within this group of the ResultSet.
      Type Parameters:
      T - Value type
      Parameters:
      expr - Grouped expression
      Returns:
      Value of given expression in this group
      Throws:
      NoSuchElementException - if group is undefined.
      ClassCastException - if group is of different type (e.g. Set)
    • getSet

      <T> Set<T> getSet(Expression<T> expr)
      Returns a Set of values in this group.
      Type Parameters:
      T - Value type of Set
      Parameters:
      expr - Grouped expression
      Returns:
      Set of values in this group
      Throws:
      NoSuchElementException - if group is undefined.
      ClassCastException - if group is of different type (e.g. List)
    • getSortedSet

      <T> SortedSet<T> getSortedSet(Expression<T> expr)
      Returns a SortedSet of values in this group.
      Type Parameters:
      T - Value type of Set
      Parameters:
      expr - Grouped expression
      Returns:
      Set of values in this group
      Throws:
      NoSuchElementException - if group is undefined.
      ClassCastException - if group is of different type (e.g. List)
    • getList

      <T> List<T> getList(Expression<T> expr)
      Returns a List of values in this group.
      Type Parameters:
      T - Value type of List
      Parameters:
      expr - Grouped expression
      Returns:
      List of values in this group
      Throws:
      NoSuchElementException - if group is undefined.
      ClassCastException - if group is of different type (e.g. Set)
    • getMap

      <K, V> Map<K,V> getMap(Expression<K> key, Expression<V> value)
      Returns a Map of values in this group
      Type Parameters:
      K - Key type of result Map
      V - Value type of result Map
      Parameters:
      key - Key expression
      value - Value expression
      Returns:
      Map of values in this group
      Throws:
      NoSuchElementException - if group is undefined.
      ClassCastException - if group is of different type (e.g. List)
    • getSortedMap

      <K, V> SortedMap<K,V> getSortedMap(Expression<K> key, Expression<V> value)
      Returns a SortedMap of values in this group
      Type Parameters:
      K - Key type of result Map
      V - Value type of result Map
      Parameters:
      key - Key expression
      value - Value expression
      Returns:
      Map of values in this group
      Throws:
      NoSuchElementException - if group is undefined.
      ClassCastException - if group is of different type (e.g. List)