ca.sqlpower.architect.olap
Class MondrianModel.Schema

java.lang.Object
  extended by ca.sqlpower.architect.olap.OLAPObject
      extended by ca.sqlpower.architect.olap.MondrianModel.Schema
Enclosing class:
MondrianModel

public static class MondrianModel.Schema
extends OLAPObject

A schema is a collection of cubes and virtual cubes. It can also contain shared dimensions (for use by those cubes), named sets, roles, and declarations of user-defined functions.


Field Summary
 
Fields inherited from class ca.sqlpower.architect.olap.OLAPObject
pcs
 
Constructor Summary
MondrianModel.Schema()
          Creates a new Schema with all attributes set to their defaults.
MondrianModel.Schema(MondrianModel.Schema original)
          Creates a new Schema with all attributes copied from the given Schema.
 
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 addCube(int pos, MondrianModel.Cube newChild)
          Adds the given child object at the specified position, firing an OLAPChildEvent.
 void addCube(MondrianModel.Cube newChild)
          Adds the given child object at the end of the child list, firing an OLAPChildEvent.
 void addDimension(int pos, MondrianModel.Dimension newChild)
          Adds the given child object at the specified position, firing an OLAPChildEvent.
 void addDimension(MondrianModel.Dimension newChild)
          Adds the given child object at the end of the child list, firing an OLAPChildEvent.
 void addNamedSet(int pos, MondrianModel.NamedSet newChild)
          Adds the given child object at the specified position, firing an OLAPChildEvent.
 void addNamedSet(MondrianModel.NamedSet newChild)
          Adds the given child object at the end of the child list, firing an OLAPChildEvent.
 void addParameter(int pos, MondrianModel.Parameter newChild)
          Adds the given child object at the specified position, firing an OLAPChildEvent.
 void addParameter(MondrianModel.Parameter newChild)
          Adds the given child object at the end of the child list, firing an OLAPChildEvent.
 void addRole(int pos, MondrianModel.Role newChild)
          Adds the given child object at the specified position, firing an OLAPChildEvent.
 void addRole(MondrianModel.Role newChild)
          Adds the given child object at the end of the child list, firing an OLAPChildEvent.
 void addUserDefinedFunction(int pos, MondrianModel.UserDefinedFunction newChild)
          Adds the given child object at the specified position, firing an OLAPChildEvent.
 void addUserDefinedFunction(MondrianModel.UserDefinedFunction newChild)
          Adds the given child object at the end of the child list, firing an OLAPChildEvent.
 void addVirtualCube(int pos, MondrianModel.VirtualCube newChild)
          Adds the given child object at the specified position, firing an OLAPChildEvent.
 void addVirtualCube(MondrianModel.VirtualCube newChild)
          Adds the given child object at the end of the child list, firing an OLAPChildEvent.
 boolean allowsChildren()
          Returns true if this type of OLAPObject can ever return a non-empty list from OLAPObject.getChildren(), and false if getChildren() is always empty.
 java.util.List<OLAPObject> getChildren()
          Returns a read-only unified list of all children of this OLAPObject.
 java.util.List<MondrianModel.Cube> getCubes()
           
 java.lang.String getDefaultRole()
           
 java.util.List<MondrianModel.Dimension> getDimensions()
           
 java.lang.String getMeasuresCaption()
           
 java.lang.String getName()
          Default implementation.
 java.util.List<MondrianModel.NamedSet> getNamedSets()
           
 java.util.List<MondrianModel.Parameter> getParameters()
           
 java.util.List<MondrianModel.Role> getRoles()
           
 java.util.List<MondrianModel.UserDefinedFunction> getUserDefinedFunctions()
           
 java.util.List<MondrianModel.VirtualCube> getVirtualCubes()
           
 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.
 MondrianModel.Cube removeCube(int pos)
          Removes the child object at the given position, firing an OLAPChildEvent.
 boolean removeCube(MondrianModel.Cube removeChild)
          Removes the given child object, firing an OLAPChildEvent if the child was found.
 MondrianModel.Dimension removeDimension(int pos)
          Removes the child object at the given position, firing an OLAPChildEvent.
 boolean removeDimension(MondrianModel.Dimension removeChild)
          Removes the given child object, firing an OLAPChildEvent if the child was found.
 MondrianModel.NamedSet removeNamedSet(int pos)
          Removes the child object at the given position, firing an OLAPChildEvent.
 boolean removeNamedSet(MondrianModel.NamedSet removeChild)
          Removes the given child object, firing an OLAPChildEvent if the child was found.
 MondrianModel.Parameter removeParameter(int pos)
          Removes the child object at the given position, firing an OLAPChildEvent.
 boolean removeParameter(MondrianModel.Parameter removeChild)
          Removes the given child object, firing an OLAPChildEvent if the child was found.
 MondrianModel.Role removeRole(int pos)
          Removes the child object at the given position, firing an OLAPChildEvent.
 boolean removeRole(MondrianModel.Role removeChild)
          Removes the given child object, firing an OLAPChildEvent if the child was found.
 MondrianModel.UserDefinedFunction removeUserDefinedFunction(int pos)
          Removes the child object at the given position, firing an OLAPChildEvent.
 boolean removeUserDefinedFunction(MondrianModel.UserDefinedFunction removeChild)
          Removes the given child object, firing an OLAPChildEvent if the child was found.
 MondrianModel.VirtualCube removeVirtualCube(int pos)
          Removes the child object at the given position, firing an OLAPChildEvent.
 boolean removeVirtualCube(MondrianModel.VirtualCube removeChild)
          Removes the given child object, firing an OLAPChildEvent if the child was found.
 void setDefaultRole(java.lang.String newval)
           
 void setMeasuresCaption(java.lang.String newval)
           
 void setName(java.lang.String newval)
           
 java.lang.String toString()
           
 
Methods inherited from class ca.sqlpower.architect.olap.OLAPObject
addChildListener, addCompoundEditListener, addPropertyChangeListener, endCompoundEdit, fireChildAdded, fireChildRemoved, getParent, removeChildListener, removeCompoundEditListener, removePropertyChangeListener, startCompoundEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MondrianModel.Schema

public MondrianModel.Schema()
Creates a new Schema with all attributes set to their defaults.


MondrianModel.Schema

public MondrianModel.Schema(MondrianModel.Schema original)
Creates a new Schema with all attributes copied from the given Schema.

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()
Description copied from class: OLAPObject
Default implementation. Subclasses that have actual names will override this method.

Overrides:
getName in class OLAPObject

setName

public void setName(java.lang.String newval)

getMeasuresCaption

public java.lang.String getMeasuresCaption()

setMeasuresCaption

public void setMeasuresCaption(java.lang.String newval)

getDefaultRole

public java.lang.String getDefaultRole()

setDefaultRole

public void setDefaultRole(java.lang.String newval)

addParameter

public void addParameter(int pos,
                         MondrianModel.Parameter newChild)
Adds the given child object at the specified position, firing an OLAPChildEvent. This schema's parameter definitions.


addParameter

public void addParameter(MondrianModel.Parameter newChild)
Adds the given child object at the end of the child list, firing an OLAPChildEvent. This schema's parameter definitions.


removeParameter

public boolean removeParameter(MondrianModel.Parameter removeChild)
Removes the given child object, firing an OLAPChildEvent if the child was found.

Returns:
true if the item was removed (because it was in the list); false if the item was not removed.

removeParameter

public MondrianModel.Parameter removeParameter(int pos)
Removes the child object at the given position, firing an OLAPChildEvent.

Returns:
The item that was removed.

getParameters

public java.util.List<MondrianModel.Parameter> getParameters()

addDimension

public void addDimension(int pos,
                         MondrianModel.Dimension newChild)
Adds the given child object at the specified position, firing an OLAPChildEvent. Shared dimensions in this schema.


addDimension

public void addDimension(MondrianModel.Dimension newChild)
Adds the given child object at the end of the child list, firing an OLAPChildEvent. Shared dimensions in this schema.


removeDimension

public boolean removeDimension(MondrianModel.Dimension removeChild)
Removes the given child object, firing an OLAPChildEvent if the child was found.

Returns:
true if the item was removed (because it was in the list); false if the item was not removed.

removeDimension

public MondrianModel.Dimension removeDimension(int pos)
Removes the child object at the given position, firing an OLAPChildEvent.

Returns:
The item that was removed.

getDimensions

public java.util.List<MondrianModel.Dimension> getDimensions()

addCube

public void addCube(int pos,
                    MondrianModel.Cube newChild)
Adds the given child object at the specified position, firing an OLAPChildEvent. Cubes in this schema.


addCube

public void addCube(MondrianModel.Cube newChild)
Adds the given child object at the end of the child list, firing an OLAPChildEvent. Cubes in this schema.


removeCube

public boolean removeCube(MondrianModel.Cube removeChild)
Removes the given child object, firing an OLAPChildEvent if the child was found.

Returns:
true if the item was removed (because it was in the list); false if the item was not removed.

removeCube

public MondrianModel.Cube removeCube(int pos)
Removes the child object at the given position, firing an OLAPChildEvent.

Returns:
The item that was removed.

getCubes

public java.util.List<MondrianModel.Cube> getCubes()

addVirtualCube

public void addVirtualCube(int pos,
                           MondrianModel.VirtualCube newChild)
Adds the given child object at the specified position, firing an OLAPChildEvent. Virtual cubes in this schema.


addVirtualCube

public void addVirtualCube(MondrianModel.VirtualCube newChild)
Adds the given child object at the end of the child list, firing an OLAPChildEvent. Virtual cubes in this schema.


removeVirtualCube

public boolean removeVirtualCube(MondrianModel.VirtualCube removeChild)
Removes the given child object, firing an OLAPChildEvent if the child was found.

Returns:
true if the item was removed (because it was in the list); false if the item was not removed.

removeVirtualCube

public MondrianModel.VirtualCube removeVirtualCube(int pos)
Removes the child object at the given position, firing an OLAPChildEvent.

Returns:
The item that was removed.

getVirtualCubes

public java.util.List<MondrianModel.VirtualCube> getVirtualCubes()

addNamedSet

public void addNamedSet(int pos,
                        MondrianModel.NamedSet newChild)
Adds the given child object at the specified position, firing an OLAPChildEvent. Named sets in this schema.


addNamedSet

public void addNamedSet(MondrianModel.NamedSet newChild)
Adds the given child object at the end of the child list, firing an OLAPChildEvent. Named sets in this schema.


removeNamedSet

public boolean removeNamedSet(MondrianModel.NamedSet removeChild)
Removes the given child object, firing an OLAPChildEvent if the child was found.

Returns:
true if the item was removed (because it was in the list); false if the item was not removed.

removeNamedSet

public MondrianModel.NamedSet removeNamedSet(int pos)
Removes the child object at the given position, firing an OLAPChildEvent.

Returns:
The item that was removed.

getNamedSets

public java.util.List<MondrianModel.NamedSet> getNamedSets()

addRole

public void addRole(int pos,
                    MondrianModel.Role newChild)
Adds the given child object at the specified position, firing an OLAPChildEvent. Roles in this schema.


addRole

public void addRole(MondrianModel.Role newChild)
Adds the given child object at the end of the child list, firing an OLAPChildEvent. Roles in this schema.


removeRole

public boolean removeRole(MondrianModel.Role removeChild)
Removes the given child object, firing an OLAPChildEvent if the child was found.

Returns:
true if the item was removed (because it was in the list); false if the item was not removed.

removeRole

public MondrianModel.Role removeRole(int pos)
Removes the child object at the given position, firing an OLAPChildEvent.

Returns:
The item that was removed.

getRoles

public java.util.List<MondrianModel.Role> getRoles()

addUserDefinedFunction

public void addUserDefinedFunction(int pos,
                                   MondrianModel.UserDefinedFunction newChild)
Adds the given child object at the specified position, firing an OLAPChildEvent. Declarations of user-defined functions in this schema.


addUserDefinedFunction

public void addUserDefinedFunction(MondrianModel.UserDefinedFunction newChild)
Adds the given child object at the end of the child list, firing an OLAPChildEvent. Declarations of user-defined functions in this schema.


removeUserDefinedFunction

public boolean removeUserDefinedFunction(MondrianModel.UserDefinedFunction removeChild)
Removes the given child object, firing an OLAPChildEvent if the child was found.

Returns:
true if the item was removed (because it was in the list); false if the item was not removed.

removeUserDefinedFunction

public MondrianModel.UserDefinedFunction removeUserDefinedFunction(int pos)
Removes the child object at the given position, firing an OLAPChildEvent.

Returns:
The item that was removed.

getUserDefinedFunctions

public java.util.List<MondrianModel.UserDefinedFunction> getUserDefinedFunctions()

getChildren

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

Specified by:
getChildren in class OLAPObject

allowsChildren

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

Specified by:
allowsChildren in class OLAPObject

addChild

public void addChild(OLAPObject child)
Description copied from class: OLAPObject
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.

Overrides:
addChild in class OLAPObject
Parameters:
child - The child to add.

addChild

public void addChild(int index,
                     OLAPObject child)
Description copied from class: OLAPObject
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.

Overrides:
addChild in class OLAPObject
Parameters:
index - The overall index (same index as would be in OLAPObject.getChildren()) at which to add the child.
child - The child to add.

removeChild

public boolean removeChild(OLAPObject child)
Description copied from class: OLAPObject
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.

Overrides:
removeChild in class OLAPObject
Parameters:
child - The child to remove.


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