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 ClassesModifier and TypeInterfaceDescriptionstatic enum
Defines which selection operators are allowed, relative to a root member. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addContext
(Selection selection) void
Registers a new listener for a QueryNode.Parent Dimension of the root selection element.Returns the root selection element of this selection.The selection context includes selections from other dimensions that help determine the entire context of a selection, so drill down is possible.Unique name of the selection root.void
removeContext
(Selection selection) void
De-registers a new listener for a QueryNode.void
setOperator
(Selection.Operator operator) Set the selection operator to use.visit()
Visitor pattern-like function to convert the selection into a ParseTreeNode.
-
Method Details
-
getUniqueName
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
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
-
removeContext
-
getOperator
Selection.Operator getOperator() -
setOperator
Set the selection operator to use.- Parameters:
operator
- Operator to apply on the selection.- Throws:
IllegalArgumentException
- if the operator cannot be used on the root selection member.
-
addQueryNodeListener
Registers a new listener for a QueryNode.- Parameters:
l
- The new listener object, implementation of QueryNodeListener- See Also:
-
removeQueryNodeListener
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:
-