com.tonbeller.jpivot.olap.model
Class OlapUtils

java.lang.Object
  extended by com.tonbeller.jpivot.olap.model.OlapUtils

public class OlapUtils
extends java.lang.Object

Misc helpers

Author:
av

Method Summary
static boolean compareMembers(Member[] aMem1, Member[] aMem2)
          compare member array
static int countHierarchies(Axis axis)
          returns the number of members on each position
static java.util.Set getActiveSlicerDimensions(OlapModel model)
          Return a list of active dimensions on the slicer
static java.util.Set getActiveSlicerHierarchies(OlapModel model)
          Return a list of active dimensions on the slicer
static java.util.List getCellList(Cell[][] matrix)
          creates a list of cells out of a matrix
static Cell[][] getCellMatrix(Result result)
          returns a matrix[rows][columns] of cells
static Level getChildLevel(Level level)
           
static Level getLowestLevel(Hierarchy hier)
           
static Level getParentLevel(Level level)
           
static java.util.Set getSlicerDimensions(OlapModel model)
          return the dimensions that are on the slicer axis (all that are not visible)
static java.util.Set getSlicerHierarchies(OlapModel model)
          return the hierarchies that are on the slicer axis (all that are not visible)
static java.util.Set getVisibleDimensions(OlapModel model)
          return the dimensions that are displayed on a visible axis
static boolean isInfixFunction(java.lang.String fuName)
          check, whether a function name matches an infis function like "+" or "-"
static boolean isPrefixFunction(java.lang.String fuName)
          check, whether a function name matches an prefix function like "not" or "unary -"
static boolean isSingleRecord(Dimension dim)
          true if for every member of the lowest level of any hierarchy in dim there is a corresponding row in the fact table.
static boolean isSingleRecord(Hierarchy hier)
          true if for every member of the lowest level of hier there is a corresponding row in the fact table.
static Cell[][] transposeCellMatrix(Cell[][] oldCells)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCellMatrix

public static Cell[][] getCellMatrix(Result result)
returns a matrix[rows][columns] of cells

Parameters:
result - - a 0, 1, or 2 dimensional Result
Returns:
a matrix containing the result cells
See Also:
getCellList(com.tonbeller.jpivot.olap.model.Cell[][])

getCellList

public static java.util.List getCellList(Cell[][] matrix)
creates a list of cells out of a matrix

See Also:
getCellMatrix(com.tonbeller.jpivot.olap.model.Result)

transposeCellMatrix

public static Cell[][] transposeCellMatrix(Cell[][] oldCells)

countHierarchies

public static int countHierarchies(Axis axis)
returns the number of members on each position


getParentLevel

public static Level getParentLevel(Level level)

getChildLevel

public static Level getChildLevel(Level level)

compareMembers

public static boolean compareMembers(Member[] aMem1,
                                     Member[] aMem2)
compare member array

Parameters:
aMem1 -
aMem2 -
Returns:
true if member arrays compare

getVisibleDimensions

public static java.util.Set getVisibleDimensions(OlapModel model)
                                          throws OlapException
return the dimensions that are displayed on a visible axis

Throws:
OlapException

getSlicerDimensions

public static java.util.Set getSlicerDimensions(OlapModel model)
                                         throws OlapException
return the dimensions that are on the slicer axis (all that are not visible)

Throws:
OlapException

isInfixFunction

public static boolean isInfixFunction(java.lang.String fuName)
check, whether a function name matches an infis function like "+" or "-"

Parameters:
fuName -
Returns:

isPrefixFunction

public static boolean isPrefixFunction(java.lang.String fuName)
check, whether a function name matches an prefix function like "not" or "unary -"

Parameters:
fuName -
Returns:

isSingleRecord

public static boolean isSingleRecord(Hierarchy hier)
true if for every member of the lowest level of hier there is a corresponding row in the fact table. If so, the Hierarchy is handled differently in the GUI.


isSingleRecord

public static boolean isSingleRecord(Dimension dim)
true if for every member of the lowest level of any hierarchy in dim there is a corresponding row in the fact table. If so, the Hierarchy is handled differently in the GUI.


getLowestLevel

public static Level getLowestLevel(Hierarchy hier)

getActiveSlicerDimensions

public static java.util.Set getActiveSlicerDimensions(OlapModel model)
                                               throws OlapException
Return a list of active dimensions on the slicer

Throws:
OlapException

getActiveSlicerHierarchies

public static java.util.Set getActiveSlicerHierarchies(OlapModel model)
                                                throws OlapException
Return a list of active dimensions on the slicer

Throws:
OlapException

getSlicerHierarchies

public static java.util.Set getSlicerHierarchies(OlapModel model)
                                          throws OlapException
return the hierarchies that are on the slicer axis (all that are not visible)

Throws:
OlapException