ca.sqlpower.wabit.olap
Class WabitOlapAxis

java.lang.Object
  extended by ca.sqlpower.wabit.AbstractWabitObject
      extended by ca.sqlpower.wabit.olap.WabitOlapAxis
All Implemented Interfaces:
WabitObject

public class WabitOlapAxis
extends AbstractWabitObject

Wrapper class to an Olap4j Dimension. Used to load and save Olap4j Dimensions.


Constructor Summary
WabitOlapAxis(org.olap4j.Axis ordinal)
          Creates a WabitOlapDimension with the given name.
WabitOlapAxis(org.olap4j.query.QueryAxis queryAxis)
          Creates a WabitOlapAxis to wrap the given QueryAxis.
WabitOlapAxis(WabitOlapAxis axis)
          Copy Constructor.
 
Method Summary
protected  void addChildImpl(WabitObject child, int index)
          This is the object specific implementation of #addChild(WabitObject).
 void addDimension(WabitOlapDimension dimension)
          Adds an exclusion to this axis.
 void addDimension(WabitOlapDimension dimension, int index)
          Adds an exclusion to this axis at the given dimension.
 boolean allowsChildren()
          Returns true if this object may contain children.
 int childPositionOffset(java.lang.Class<? extends WabitObject> childType)
          Returns the position in the list that would be returned by getChildren() that the first object of type childClass is, or where it would be if there were any children of that type.
 java.util.List<? extends WabitObject> getChildren()
          Returns an unmodifiable list of the children in this WabitObject.
 java.util.List<WabitObject> getDependencies()
          Olap wrapper classes only depend on the wrapped Olap4j objects
 java.util.List<WabitOlapDimension> getDimensions()
          Returns the list of dimensions
 org.olap4j.Axis getOrdinal()
           
 OlapQuery getParent()
          Returns the parent of this WabitObject.
 java.lang.String getSortEvaluationLiteral()
           
 java.lang.String getSortOrder()
           
 boolean isNonEmpty()
           
protected  boolean removeChildImpl(WabitObject child)
          This is the object specific implementation of removeChild.
 void removeDependency(WabitObject dependency)
          Removes the given object as a dependency of this object.
 void setNonEmpty(boolean nonEmpty)
           
 void setSortEvaluationLiteral(java.lang.String sortEvaluationLiteral)
           
 void setSortOrder(java.lang.String sortOrder)
           
 void updateChildren()
          Updates lists of children based on children of the wrapped Dimension.
 
Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject
addChild, addWabitListener, begin, beginTransaction, cleanup, commit, commitTransaction, equals, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, generateNewUUID, getChildren, getName, getSession, getUUID, isForegroundThread, removeChild, removeWabitListener, rollback, rollbackTransaction, runInBackground, runInForeground, setName, setParent, setUUID, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WabitOlapAxis

public WabitOlapAxis(WabitOlapAxis axis)
Copy Constructor. Creates a deep copy of the given WabitOlapAxis and its children.


WabitOlapAxis

public WabitOlapAxis(org.olap4j.query.QueryAxis queryAxis)
Creates a WabitOlapAxis to wrap the given QueryAxis.


WabitOlapAxis

public WabitOlapAxis(org.olap4j.Axis ordinal)
Creates a WabitOlapDimension with the given name. Note that this creates an uninitialized wrapper, that is, it has no wrapped class until it is initialized. Until then, any getters will return cached values.

Method Detail

updateChildren

public void updateChildren()
Updates lists of children based on children of the wrapped Dimension. Calling this is the only way to make sure this wrapper is synchronized with the wrapped Dimension, and should be called any time something modifies the query's selections.


addDimension

public void addDimension(WabitOlapDimension dimension)
Adds an exclusion to this axis. Note that this will not affect the wrapped QueryAxis.


addDimension

public void addDimension(WabitOlapDimension dimension,
                         int index)
Adds an exclusion to this axis at the given dimension. Note that this will not affect the wrapped QueryAxis.


removeChildImpl

protected boolean removeChildImpl(WabitObject child)
Description copied from class: AbstractWabitObject
This is the object specific implementation of removeChild. There are checks in the removeChild method to ensure the child being removed has no dependencies and is a child of this object.

Specified by:
removeChildImpl in class AbstractWabitObject
See Also:
AbstractWabitObject.removeChild(WabitObject)

addChildImpl

protected void addChildImpl(WabitObject child,
                            int index)
Description copied from class: AbstractWabitObject
This is the object specific implementation of #addChild(WabitObject). There are checks in the #addChild(WabitObject) method to ensure that the object given here is a valid child type of this object.

This method should be overwritten if children are allowed.

Overrides:
addChildImpl in class AbstractWabitObject
Parameters:
child - The child to add to this object.
index - The index to add the child at.

allowsChildren

public boolean allowsChildren()
Description copied from interface: WabitObject
Returns true if this object may contain children. Not all types of WabitObjects can be a child to any WabitObject.

See Also:
WabitObject.childPositionOffset(Class)

childPositionOffset

public int childPositionOffset(java.lang.Class<? extends WabitObject> childType)
Description copied from interface: WabitObject
Returns the position in the list that would be returned by getChildren() that the first object of type childClass is, or where it would be if there were any children of that type.


getChildren

public java.util.List<? extends WabitObject> getChildren()
Description copied from interface: WabitObject
Returns an unmodifiable list of the children in this WabitObject. If there are no children in this WabitObject an empty list should be returned.


getDependencies

public java.util.List<WabitObject> getDependencies()
Olap wrapper classes only depend on the wrapped Olap4j objects


removeDependency

public void removeDependency(WabitObject dependency)
Description copied from interface: WabitObject
Removes the given object as a dependency of this object. For this object to no longer be dependent on the given dependency all of its children must also not be dependent on the given dependency when this method returns. This may remove this object from its parent if necessary.


getDimensions

public java.util.List<WabitOlapDimension> getDimensions()
Returns the list of dimensions


setNonEmpty

public void setNonEmpty(boolean nonEmpty)

isNonEmpty

public boolean isNonEmpty()

setSortOrder

public void setSortOrder(java.lang.String sortOrder)

getSortOrder

public java.lang.String getSortOrder()

setSortEvaluationLiteral

public void setSortEvaluationLiteral(java.lang.String sortEvaluationLiteral)

getSortEvaluationLiteral

public java.lang.String getSortEvaluationLiteral()

getOrdinal

public org.olap4j.Axis getOrdinal()

getParent

public OlapQuery getParent()
Description copied from interface: WabitObject
Returns the parent of this WabitObject. This will be null when the object is first created until it is added as a child to another object. If this object is never added as a child to another object this will remain null and the object may be treated as the root node of a WabitObject tree.

Specified by:
getParent in interface WabitObject
Overrides:
getParent in class AbstractWabitObject
Returns:
The parent of this object.


Copyright © 2009. All Rights Reserved.