Package org.teiid.query.sql.lang
Class GroupBy
- java.lang.Object
-
- org.teiid.query.sql.lang.GroupBy
-
- All Implemented Interfaces:
Cloneable
,LanguageObject
public class GroupBy extends Object implements LanguageObject
This class represents the GROUP BY clause of a query, which defines the expressions that should be used for grouping the results of the query. The groups produced in the query are grouped on all symbols listed contained in the GROUP BY clause. The GROUP BY clause may not contain aliased elements, expressions, or constants.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
-
-
Constructor Summary
Constructors Constructor Description GroupBy()
Constructs a default instance of this class.GroupBy(List<? extends Expression> symbols)
Constructs an instance of this class from an ordered set of symbols.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.void
addSymbol(Expression symbol)
Adds a new symbol to the list of symbols.Object
clone()
Return a deep copy of this objectboolean
equals(Object obj)
Compare two GroupBys for equality.int
getCount()
Returns the number of symbols in the GROUP BYList<Expression>
getSymbols()
Returns an ordered list of the symbols in the GROUP BYint
hashCode()
Get hashcode for GroupBy.boolean
isRollup()
void
setRollup(boolean rollup)
String
toString()
Returns a string representation of an instance of this class.
-
-
-
Constructor Detail
-
GroupBy
public GroupBy()
Constructs a default instance of this class.
-
GroupBy
public GroupBy(List<? extends Expression> symbols)
Constructs an instance of this class from an ordered set of symbols.- Parameters:
symbols
- The ordered list ofElementSymbol
s
-
-
Method Detail
-
getCount
public int getCount()
Returns the number of symbols in the GROUP BY- Returns:
- Count of the number of symbols in GROUP BY
-
getSymbols
public List<Expression> getSymbols()
Returns an ordered list of the symbols in the GROUP BY- Returns:
- List of
ElementSymbol
s
-
addSymbol
public void addSymbol(Expression symbol)
Adds a new symbol to the list of symbols.- Parameters:
symbol
- Symbol to add to GROUP BY
-
acceptVisitor
public void acceptVisitor(LanguageVisitor visitor)
Description copied from interface:LanguageObject
Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.- Specified by:
acceptVisitor
in interfaceLanguageObject
- Parameters:
visitor
- Visitor being used
-
clone
public Object clone()
Return a deep copy of this object- Specified by:
clone
in interfaceLanguageObject
- Overrides:
clone
in classObject
- Returns:
- Deep copy of object
-
equals
public boolean equals(Object obj)
Compare two GroupBys for equality. Order is important in the comparison.
-
hashCode
public int hashCode()
Get hashcode for GroupBy. WARNING: The hash code relies on the variables in the group by, so changing the variables will change the hash code, causing a group by to be lost in a hash structure. Do not hash a GroupBy if you plan to change it.
-
toString
public String toString()
Returns a string representation of an instance of this class.
-
isRollup
public boolean isRollup()
-
setRollup
public void setRollup(boolean rollup)
-
-