com.tonbeller.jpivot.olap.query
Class QueryAdapter

java.lang.Object
  extended by com.tonbeller.jpivot.olap.query.QueryAdapter
Direct Known Subclasses:
MondrianQueryAdapter, XMLA_QueryAdapter

public abstract class QueryAdapter
extends java.lang.Object

Adapt the MDX query to the model


Nested Class Summary
static interface QueryAdapter.QueryAdapterHolder
          ask a QueryAdapterHolder to get a query adapter
 
Field Summary
protected  boolean axesSwapped
           
protected  boolean genMDXHierarchize
           
protected  ModelSupport model
           
protected  Quax[] quaxes
           
protected  SortRankBase sortMan
           
protected  boolean useQuax
           
 
Constructor Summary
protected QueryAdapter(ModelSupport model)
          c'tor
 
Method Summary
 void afterExecute(Result result)
          after the startup query was run: get the current positions as array of array of member.
abstract  boolean canCollapse(Member member)
           
abstract  boolean canCollapse(Member[] pathMembers)
           
abstract  boolean canDrillDown(Member member)
          drill down is possible if member has children
 boolean canDrillUp(Hierarchy hier)
          drill up is possible if at least one member in the tree is not at the top level of this hierarchy.
abstract  boolean canExpand(Member member)
          find out, whether a member can be expanded.
abstract  boolean canExpand(Member[] pathMembers)
           
 void collapse(Member member)
          collapse a member in all positions
 void collapse(Member[] pathMembers)
          collapse a member in a specific position
protected abstract  java.lang.Object createMemberSet(java.util.List memList)
          create set expression for list of members
 void drillDown(Member member)
          After switch to Qubon mode: replaces the members.
 void drillUp(Hierarchy hier)
          After switch to Qubon mode: replaces all visible members of hier with the members of the next higher level.
 void expand(Member member)
          expand a member in all positions this is done by applying ToggleDrillState to the Query
 void expand(Member[] pathMembers)
          expand a member in a specific position
 Quax findQuax(Dimension dim)
          find the Quax for a specific dimension
 Quax[] getQuaxes()
           
 int iASwap(int i)
          swap axis index if neccessary
 boolean isSwapAxes()
           
 boolean isUseQuax()
           
protected  java.lang.String poString(Member[] posMembers, Member member)
          display position member for debugging purposes
 void setQuaxes(Quax[] quaxes)
           
 void setUseQuax(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected ModelSupport model

quaxes

protected Quax[] quaxes

useQuax

protected boolean useQuax

axesSwapped

protected boolean axesSwapped

genMDXHierarchize

protected boolean genMDXHierarchize

sortMan

protected SortRankBase sortMan
Constructor Detail

QueryAdapter

protected QueryAdapter(ModelSupport model)
c'tor

Parameters:
model -
Method Detail

getQuaxes

public Quax[] getQuaxes()
Returns:

setQuaxes

public void setQuaxes(Quax[] quaxes)
Parameters:
quaxs -

findQuax

public Quax findQuax(Dimension dim)
find the Quax for a specific dimension

Parameters:
dim - Dimension
Returns:
Quax containg dimension

afterExecute

public void afterExecute(Result result)
after the startup query was run: get the current positions as array of array of member. Called from Model.getResult after the query was executed.

Parameters:
result - the result which redefines the query axes

createMemberSet

protected abstract java.lang.Object createMemberSet(java.util.List memList)
create set expression for list of members

Parameters:
memList -
Returns:
set expression

canExpand

public abstract boolean canExpand(Member member)
find out, whether a member can be expanded. this is true, if - the member is on an axis and - the member is not yet expanded and - the member has children

Parameters:
Member - to be expanded
Returns:
true if the member can be expanded
See Also:
com.tonbeller.jpivot.olap.navi.DrillExpand#canExpand(Member)

canExpand

public abstract boolean canExpand(Member[] pathMembers)
Parameters:
position - position to be expanded
Member - to be expanded
Returns:
true if the member can be expanded
See Also:
com.tonbeller.jpivot.olap.navi.DrillExpand#canExpand(Member)

canCollapse

public abstract boolean canCollapse(Member member)
Parameters:
Member - to be collapsed
Returns:
true if the member can be collapsed
See Also:
com.tonbeller.jpivot.olap.navi.DrillExpand#canExpand(Member)

canCollapse

public abstract boolean canCollapse(Member[] pathMembers)
Parameters:
position - position to be expanded
Returns:
true if the position can be collapsed
See Also:
com.tonbeller.jpivot.olap.navi.DrillExpand#canCollapse(Member)

expand

public void expand(Member member)
expand a member in all positions this is done by applying ToggleDrillState to the Query

Parameters:
Member - member to be expanded
See Also:
com.tonbeller.jpivot.olap.navi.DrillExpand#expand(Member)

expand

public void expand(Member[] pathMembers)
expand a member in a specific position

Parameters:
position - position to be expanded
Member - member to be expanded
See Also:
com.tonbeller.jpivot.olap.navi.DrillExpand#expand(Member)

collapse

public void collapse(Member member)
collapse a member in all positions

Parameters:
Member - member to be collapsed
See Also:
com.tonbeller.jpivot.olap.navi.DrillExpand#expand(Member)

collapse

public void collapse(Member[] pathMembers)
collapse a member in a specific position

Parameters:
position - position to be collapsed
See Also:
com.tonbeller.jpivot.olap.navi.DrillExpand#expand(Member)

canDrillDown

public abstract boolean canDrillDown(Member member)
drill down is possible if member has children


canDrillUp

public boolean canDrillUp(Hierarchy hier)
drill up is possible if at least one member in the tree is not at the top level of this hierarchy.


drillDown

public void drillDown(Member member)
After switch to Qubon mode: replaces the members. Let H be the hierarchy that member belongs to. Then drillDown will replace all members from H that are currently visible with the children of member.


drillUp

public void drillUp(Hierarchy hier)
After switch to Qubon mode: replaces all visible members of hier with the members of the next higher level.


isSwapAxes

public boolean isSwapAxes()
Returns:
true, if axes are currently swapped

iASwap

public int iASwap(int i)
swap axis index if neccessary

Parameters:
original - index
Returns:
swapped index

poString

protected java.lang.String poString(Member[] posMembers,
                                    Member member)
display position member for debugging purposes

Parameters:
posMembers -
member -
Returns:

isUseQuax

public boolean isUseQuax()
Returns:
true if quas is to be used

setUseQuax

public void setUseQuax(boolean b)
Parameters:
b - - true if quas is to be used