Package org.olap4j.query
Interface Selection
-
public interface Selection
A selection of members from an OLAP dimension hierarchy. The selection is a conceptual list of members from a given hierarchy. Once a selection object is created, one can decide to include or exclude this selection of members from the resulting query.Concrete subclasses of this represent a real selection. Selections include things such as 'children of', 'siblings of', 'descendents of' etc.
This class is different from a
Member
because it represents an abstract member selection (e.g. children of widget' that may not represent any members whereas a Member represents a single member that is known to exist.- Since:
- May 30, 2007
- Author:
- jdixon, jhyde, Luc Boudreau
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Selection.Operator
Defines which selection operators are allowed, relative to a root member.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addContext(Selection selection)
void
addQueryNodeListener(QueryNodeListener l)
Registers a new listener for a QueryNode.Dimension
getDimension()
Parent Dimension of the root selection element.Selection.Operator
getOperator()
MetadataElement
getRootElement()
Returns the root selection element of this selection.java.util.List<Selection>
getSelectionContext()
The selection context includes selections from other dimensions that help determine the entire context of a selection, so drill down is possible.java.lang.String
getUniqueName()
Unique name of the selection root.void
removeContext(Selection selection)
void
removeQueryNodeListener(QueryNodeListener l)
De-registers a new listener for a QueryNode.void
setOperator(Selection.Operator operator)
Set the selection operator to use.ParseTreeNode
visit()
Visitor pattern-like function to convert the selection into a ParseTreeNode.
-
-
-
Method Detail
-
getUniqueName
java.lang.String getUniqueName()
Unique name of the selection root.- Returns:
- The unique OLAP name of the selection root.
-
visit
ParseTreeNode visit()
Visitor pattern-like function to convert the selection into a ParseTreeNode. Typical implementation should be:
Olap4jNodeConverter.toOlap4j(member, operator);
- Returns:
- A parse tree node of the selection.
-
getDimension
Dimension getDimension()
Parent Dimension of the root selection element.- Returns:
- A dimension object.
-
getRootElement
MetadataElement getRootElement()
Returns the root selection element of this selection.- Returns:
- The root metadata object.
-
getSelectionContext
java.util.List<Selection> getSelectionContext()
The selection context includes selections from other dimensions that help determine the entire context of a selection, so drill down is possible.- Returns:
- list of selections
-
addContext
void addContext(Selection selection)
-
removeContext
void removeContext(Selection selection)
-
getOperator
Selection.Operator getOperator()
-
setOperator
void setOperator(Selection.Operator operator)
Set the selection operator to use.- Parameters:
operator
- Operator to apply on the selection.- Throws:
java.lang.IllegalArgumentException
- if the operator cannot be used on the root selection member.
-
addQueryNodeListener
void addQueryNodeListener(QueryNodeListener l)
Registers a new listener for a QueryNode.- Parameters:
l
- The new listener object, implementation of QueryNodeListener- See Also:
QueryNodeListener
-
removeQueryNodeListener
void removeQueryNodeListener(QueryNodeListener l)
De-registers a new listener for a QueryNode. If the listener object passed as a parameter was not registered, the method will return silently.- Parameters:
l
- The listener object to de-register.- See Also:
QueryNodeListener
-
-