ca.sqlpower.wabit.olap
Class WabitOlapSelection

java.lang.Object
  extended by ca.sqlpower.wabit.AbstractWabitObject
      extended by ca.sqlpower.wabit.olap.WabitOlapSelection
All Implemented Interfaces:
WabitObject
Direct Known Subclasses:
WabitOlapExclusion, WabitOlapInclusion

public abstract class WabitOlapSelection
extends AbstractWabitObject

Wrapper class to wrap an Olap4j Selection, that is, an Inclusion or Exclusion.


Field Summary
protected  boolean initialized
           
protected  org.olap4j.query.Selection.Operator operator
           
protected  org.olap4j.query.Selection selection
          The Selection this class wraps.
protected  java.lang.String uniqueMemberName
           
 
Constructor Summary
WabitOlapSelection(org.olap4j.query.Selection.Operator operator, java.lang.String uniqueMemberName)
          Creates a new WabitOlapSelection with the given properties.
WabitOlapSelection(org.olap4j.query.Selection selection)
          Creates a new WabitOlapSelection to wrap the given Selection.
WabitOlapSelection(WabitOlapSelection selection)
          Copy Constructor.
 
Method Summary
 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()
          Selections are leaf nodes.
 java.util.List<WabitObject> getDependencies()
          Olap wrapper classes only depend on the wrapped Olap4j objects
 org.olap4j.query.Selection.Operator getOperator()
          Returns the Selection.Operator associated with the wrapped Selection, or the cached Operator if this object hasn't been initialized.
 java.lang.String getUniqueMemberName()
          Returns the unique member name associated with the wrapped Selection, or the cached Operator if this object hasn't been initialized.
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.
 
Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject
addChild, addChildImpl, addWabitListener, begin, beginTransaction, cleanup, commit, commitTransaction, equals, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, generateNewUUID, getChildren, getName, getParent, 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
 

Field Detail

selection

protected org.olap4j.query.Selection selection
The Selection this class wraps. Should not be leaked out of the wabit.olap package.


operator

protected final org.olap4j.query.Selection.Operator operator

uniqueMemberName

protected final java.lang.String uniqueMemberName

initialized

protected boolean initialized
Constructor Detail

WabitOlapSelection

public WabitOlapSelection(WabitOlapSelection selection)
Copy Constructor. Creates a new WabitOlapSelection with the same properties as the parameter.


WabitOlapSelection

public WabitOlapSelection(org.olap4j.query.Selection selection)
Creates a new WabitOlapSelection to wrap the given Selection.


WabitOlapSelection

public WabitOlapSelection(org.olap4j.query.Selection.Operator operator,
                          java.lang.String uniqueMemberName)
Creates a new WabitOlapSelection with the given properties. 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

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)

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()
Selections are leaf nodes.


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.


getOperator

public org.olap4j.query.Selection.Operator getOperator()
Returns the Selection.Operator associated with the wrapped Selection, or the cached Operator if this object hasn't been initialized.


getUniqueMemberName

public java.lang.String getUniqueMemberName()
Returns the unique member name associated with the wrapped Selection, or the cached Operator if this object hasn't been initialized.



Copyright © 2009. All Rights Reserved.