com.mysema.query.group
Interface Group


public interface Group

A group of rows. Group is build according to GroupDefinitions.

Author:
sasa

Method Summary
<T,R> R
getGroup(GroupExpression<T,R> coldef)
          Returns the value of the given group.
<T> List<T>
getList(Expression<T> expr)
          Returns a List of values in this group.
<K,V> Map<K,V>
getMap(Expression<K> key, Expression<V> value)
          Returns a Map of values in this group
<T> T
getOne(Expression<T> expr)
          Returns the value of the given single valued expression.
<T> Set<T>
getSet(Expression<T> expr)
          Returns a Set of values in this group.
 Object[] toArray()
           
 

Method Detail

toArray

Object[] toArray()
Returns:
Groups 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)

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)


Copyright © 2007-2012 Mysema Ltd. All Rights Reserved.