ca.sqlpower.architect.olap
Class OLAPObject

java.lang.Object
  extended by ca.sqlpower.architect.olap.OLAPObject
Direct Known Subclasses:
MondrianModel.AggColumnName, MondrianModel.AggExclude, MondrianModel.AggForeignKey, MondrianModel.AggLevel, MondrianModel.AggMeasure, MondrianModel.AggTable, MondrianModel.CalculatedMember, MondrianModel.CalculatedMemberProperty, MondrianModel.Closure, MondrianModel.ColumnDef, MondrianModel.ColumnDefs, MondrianModel.Cube, MondrianModel.CubeDimension, MondrianModel.CubeUsage, MondrianModel.CubeUsages, MondrianModel.Expression, MondrianModel.Formula, MondrianModel.Grant, MondrianModel.Hierarchy, MondrianModel.Level, MondrianModel.Measure, MondrianModel.MemberGrant, MondrianModel.MemberReaderParameter, MondrianModel.NamedSet, MondrianModel.Parameter, MondrianModel.Property, MondrianModel.RelationOrJoin, MondrianModel.Role, MondrianModel.RoleUsage, MondrianModel.Row, MondrianModel.Rows, MondrianModel.Schema, MondrianModel.SQL, MondrianModel.Union, MondrianModel.UserDefinedFunction, MondrianModel.Value, MondrianModel.VirtualCube, MondrianModel.VirtualCubeMeasure, OLAPRootObject, OLAPSession

public abstract class OLAPObject
extends java.lang.Object


Field Summary
protected  java.beans.PropertyChangeSupport pcs
          Helper class for registering and notifying property change listeners.
 
Constructor Summary
protected OLAPObject()
           
protected OLAPObject(OLAPObject original)
           
 
Method Summary
 void addChild(int index, OLAPObject child)
          Adds the given child or sets the appropriate property on this OLAPObject, allowing the overall target index to be specified.
 void addChild(OLAPObject child)
          Adds the given child or sets the appropriate property on this OLAPObject, if this type of OLAPObject has the applicable addXXX() or setXXX() method for the given object's type.
 void addChildListener(OLAPChildListener listener)
           
 void addCompoundEditListener(CompoundEditListener listener)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
abstract  boolean allowsChildren()
          Returns true if this type of OLAPObject can ever return a non-empty list from getChildren(), and false if getChildren() is always empty.
 void endCompoundEdit()
           
protected  void fireChildAdded(java.lang.Class<? extends OLAPObject> childClass, int index, OLAPObject child)
           
protected  void fireChildRemoved(java.lang.Class<? extends OLAPObject> childClass, int index, OLAPObject child)
           
abstract  java.util.List<? extends OLAPObject> getChildren()
          Returns a read-only unified list of all children of this OLAPObject.
 java.lang.String getName()
          Default implementation.
 OLAPObject getParent()
          Returns the current OLAPObject that is this object's parent.
 boolean removeChild(OLAPObject child)
          Removes the given child on this OLAPObject if this type of OLAPObject has the applicable removeXXX() or setXXX(null) method for the given object's type.
 void removeChildListener(OLAPChildListener listener)
           
 void removeCompoundEditListener(CompoundEditListener listener)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void startCompoundEdit(java.lang.String presentationName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pcs

protected final java.beans.PropertyChangeSupport pcs
Helper class for registering and notifying property change listeners.

Constructor Detail

OLAPObject

protected OLAPObject()

OLAPObject

protected OLAPObject(OLAPObject original)
Method Detail

getParent

public OLAPObject getParent()
Returns the current OLAPObject that is this object's parent. If this value is null, this object has no parent.


allowsChildren

public abstract boolean allowsChildren()
Returns true if this type of OLAPObject can ever return a non-empty list from getChildren(), and false if getChildren() is always empty.


getChildren

public abstract java.util.List<? extends OLAPObject> getChildren()
Returns a read-only unified list of all children of this OLAPObject. If this object doesn't have any children, returns an empty list.


addChild

public void addChild(OLAPObject child)
Adds the given child or sets the appropriate property on this OLAPObject, if this type of OLAPObject has the applicable addXXX() or setXXX() method for the given object's type.

This method in the abstract base class always throws the IllegalArgumentException because no children or properties are defined at this level.

This method isn't compile-time type safe, so it is recommended not to use it on "by-hand" usage of this API. This method is used during XML parsing, which can't be made compile-time type safe anyway.

Parameters:
child - The child to add.
Throws:
java.lang.IllegalArgumentException - if this object doesn't support child's type.

addChild

public void addChild(int index,
                     OLAPObject child)
Adds the given child or sets the appropriate property on this OLAPObject, allowing the overall target index to be specified.

This method in the abstract base class always throws IllegalArgumentException because no children or properties are defined at this level.

This method isn't compile-time type safe, so it is recommended not to use it on "by-hand" usage of this API. This method is used for undo and redo, which can't be compile-time type safe anyway.

Parameters:
index - The overall index (same index as would be in getChildren()) at which to add the child.
child - The child to add.
Throws:
java.lang.IllegalArgumentException - if this object doesn't support child's type, or if the given index is not compatible with the given child's type (children are grouped by type, and the order is strictly enforced).

removeChild

public boolean removeChild(OLAPObject child)
Removes the given child on this OLAPObject if this type of OLAPObject has the applicable removeXXX() or setXXX(null) method for the given object's type.

This method in the abstract base class always throws the IllegalArgumentException because no children or properties are defined at this level.

Parameters:
child - The child to remove.
Throws:
java.lang.IllegalArgumentException - if this object doesn't support child's type.

addChildListener

public void addChildListener(OLAPChildListener listener)

removeChildListener

public void removeChildListener(OLAPChildListener listener)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

addCompoundEditListener

public void addCompoundEditListener(CompoundEditListener listener)

removeCompoundEditListener

public void removeCompoundEditListener(CompoundEditListener listener)

startCompoundEdit

public void startCompoundEdit(java.lang.String presentationName)

endCompoundEdit

public void endCompoundEdit()

fireChildAdded

protected void fireChildAdded(java.lang.Class<? extends OLAPObject> childClass,
                              int index,
                              OLAPObject child)

fireChildRemoved

protected void fireChildRemoved(java.lang.Class<? extends OLAPObject> childClass,
                                int index,
                                OLAPObject child)

getName

public java.lang.String getName()
Default implementation. Subclasses that have actual names will override this method.



Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca