com.tonbeller.jpivot.olap.query
Class Quax

java.lang.Object
  extended by com.tonbeller.jpivot.olap.query.Quax
Direct Known Subclasses:
MondrianQuax, XMLA_Quax

public class Quax
extends java.lang.Object


Nested Class Summary
static class Quax.CannotHandleException
          indicate, that an "unknown" Funcall was not handled
 
Field Summary
protected  int nDimension
           
protected  TreeNode posTreeRoot
           
 
Constructor Summary
Quax(int ordinal)
          c'tor
 
Method Summary
 void addChangeListener(QuaxChangeListener listener)
          register change listener
protected  int addToPosTree(Member[][] aPosMem, int iStartPos, int iEndPos, int iDim, TreeNode parentNode)
          add members of dimension to tree recursively
 boolean canCollapse(Member member)
          check, whether a member path can be collapsed this is true if there is a child position path
 boolean canCollapse(Member[] pathMembers)
          check, whether a member path can be collapsed this is true if there is a child position path
 boolean canDrillDown(Member member)
          drill down is possible if there is no sticky generate
 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.
 boolean canExpand(Member member)
          check, whether a member can be expanded
 boolean canExpand(Member[] pathMembers)
          check, whether a member in a specific position path can be expanded
 void changed(java.lang.Object source, boolean changedMemberSet)
          handle change
 void collapse(Member member)
          remove child nodes of monMember
 void collapse(Member[] mPath)
          remove child positions of mPath from position tree
 int dimIdx(Dimension dim)
          find out, whether axis contains dimension
 void drillDown(Member member)
          drill down
 void drillUp(Hierarchy hier)
          drill down
 void expand(Member member)
          expand member all over position tree
 void expand(Member[] mPath)
          expand position path
 java.lang.Object genExp(boolean genHierarchize)
          MDX Generation generate Exp from tree
 java.lang.Object genExpForDim(int iDimension)
          generate Exp for all nodes of dimension iDimension
 int getGenerateIndex()
           
 int getGenerateMode()
           
 Hierarchy[] getHiers()
           
 int getNDimension()
           
 int getNHierExclude()
           
 int getOrdinal()
          get Ordinal for axis, this is the immutable id of the quax
 TreeNode getPosTreeRoot()
           
 QuaxUti getUti()
           
 void hierarchizePositions(Member[][] aPosMem)
          hierarchize the query axis position array
 void init(java.util.List positions)
          Initialize quax from result positions
 boolean isHierarchizeNeeded()
           
 boolean isQubonMode()
           
 boolean isUnknownFunction(int iHier)
           
 void regeneratePosTree(java.lang.Object[] sets, boolean hiersChanged)
          regenerate the position tree as crossjoin between sets
 void removeChangeListener(QuaxChangeListener listener)
          unregister change listener
 void resetGenerate()
          reset generate "topcount"
 void setGenerateIndex(int i)
           
 void setGenerateMode(int i)
           
 void setHierarchizeNeeded(boolean b)
           
 void setHierMemberList(int iHier, java.util.List list)
           
 void setHiers(Hierarchy[] hierarchies)
           
 void setNHierExclude(int hierExclude)
           
 void setPosTreeRoot(TreeNode posTreeRoot, boolean hiersChanged)
           
 void setQubonMode(boolean qubonMode)
           
 void setUti(QuaxUti uti)
           
 java.lang.String toString()
          String representation (debugging)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nDimension

protected int nDimension

posTreeRoot

protected TreeNode posTreeRoot
Constructor Detail

Quax

public Quax(int ordinal)
c'tor

Parameters:
ordinal -
Method Detail

addChangeListener

public void addChangeListener(QuaxChangeListener listener)
register change listener

Parameters:
listener -

removeChangeListener

public void removeChangeListener(QuaxChangeListener listener)
unregister change listener

Parameters:
listener -

changed

public void changed(java.lang.Object source,
                    boolean changedMemberSet)
handle change

Parameters:
source - Originator of the quax change
changedMemberSet - true if the memberset was changed by the navigator

init

public void init(java.util.List positions)
Initialize quax from result positions

Parameters:
positions -

addToPosTree

protected int addToPosTree(Member[][] aPosMem,
                           int iStartPos,
                           int iEndPos,
                           int iDim,
                           TreeNode parentNode)
add members of dimension to tree recursively

Parameters:
aPosMem - positon member array
iStartPos - start position for this dimension
iEndPos - start position for this dimension
iDim - index of this dimension
parentNode - parent node (previous dimension)
Returns:
index of position where the member of this dimension changes

dimIdx

public int dimIdx(Dimension dim)
find out, whether axis contains dimension

Parameters:
dim -
Returns:
index of dimension, -1 if not there

regeneratePosTree

public void regeneratePosTree(java.lang.Object[] sets,
                              boolean hiersChanged)
regenerate the position tree as crossjoin between sets

Parameters:
hiersChanged - indicates that the hierarchies were changed

canExpand

public boolean canExpand(Member[] pathMembers)
check, whether a member in a specific position path can be expanded

Parameters:
pathMembers - position path to be expanded

expand

public void expand(Member[] mPath)
expand position path

Parameters:
mPath -

canExpand

public boolean canExpand(Member member)
check, whether a member can be expanded

Parameters:
member - member to be expanded

expand

public void expand(Member member)
expand member all over position tree

Parameters:
member -

canCollapse

public boolean canCollapse(Member[] pathMembers)
check, whether a member path can be collapsed this is true if there is a child position path

Parameters:
pathMembers - position path to be collapsed

collapse

public void collapse(Member[] mPath)
remove child positions of mPath from position tree

Parameters:
mPath - member path to be collapsed

canCollapse

public boolean canCollapse(Member member)
check, whether a member path can be collapsed this is true if there is a child position path

Parameters:
member - position path to be collapsed

collapse

public void collapse(Member member)
remove child nodes of monMember

Parameters:
member - member to be collapsed

canDrillDown

public boolean canDrillDown(Member member)
drill down is possible if there is no sticky generate


drillDown

public void drillDown(Member member)
drill down

Parameters:
member - drill down member

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.


drillUp

public void drillUp(Hierarchy hier)
drill down

Parameters:
hier - drill down member

genExp

public java.lang.Object genExp(boolean genHierarchize)
MDX Generation generate Exp from tree

Returns:
Exp for axis set

toString

public java.lang.String toString()
String representation (debugging)

Overrides:
toString in class java.lang.Object

genExpForDim

public java.lang.Object genExpForDim(int iDimension)
generate Exp for all nodes of dimension iDimension

Parameters:
iDimension -
Returns:
Exp for all nodes

hierarchizePositions

public void hierarchizePositions(Member[][] aPosMem)
hierarchize the query axis position array


getUti

public QuaxUti getUti()
Returns:

setUti

public void setUti(QuaxUti uti)
Parameters:
uti -

getNDimension

public int getNDimension()
Returns:

getPosTreeRoot

public TreeNode getPosTreeRoot()
Returns:
posTreeRoot

isHierarchizeNeeded

public boolean isHierarchizeNeeded()
Returns:

setHierarchizeNeeded

public void setHierarchizeNeeded(boolean b)
Parameters:
b -

setPosTreeRoot

public void setPosTreeRoot(TreeNode posTreeRoot,
                           boolean hiersChanged)
Parameters:
posTreeRoot -

getOrdinal

public int getOrdinal()
get Ordinal for axis, this is the immutable id of the quax

Returns:
ordinal

setHiers

public void setHiers(Hierarchy[] hierarchies)
Parameters:
hierarchies -

getHiers

public Hierarchy[] getHiers()
Returns:
hierarchies

isQubonMode

public boolean isQubonMode()
Returns:

setQubonMode

public void setQubonMode(boolean qubonMode)
Parameters:
qubonMode -

getGenerateIndex

public int getGenerateIndex()

setGenerateIndex

public void setGenerateIndex(int i)

getGenerateMode

public int getGenerateMode()

setGenerateMode

public void setGenerateMode(int i)

resetGenerate

public void resetGenerate()
reset generate "topcount"


getNHierExclude

public int getNHierExclude()
Returns:
Returns the nHierExclude.

setNHierExclude

public void setNHierExclude(int hierExclude)
Parameters:
hierExclude - The nHierExclude to set.

setHierMemberList

public void setHierMemberList(int iHier,
                              java.util.List list)
Parameters:
iHier - index of Hierarchy
list - Member List

isUnknownFunction

public boolean isUnknownFunction(int iHier)
Parameters:
iHier - index of Hierarchy
Returns:
true, if the Hierarchy has an unknown function