edu.udo.cs.miningmart.m4
Interface Case

All Superinterfaces:
M4Data, M4Object
All Known Implementing Classes:
Case

public interface Case
extends M4Data

Version:
$Id: Case.java,v 1.3 2006/04/11 14:10:12 euler Exp $
Author:
Timm Euler, Daniel Hakenjos

Field Summary
static java.lang.String DESIGN_MODE
          Constant that can be used to set the Case Mode to DESIGN
static java.lang.String FINAL_MODE
          Constant that can be used to set the Case Mode to FINAL
static java.lang.String TEST_MODE
          Constant that can be used to set the Case Mode to TEST
 
Method Summary
 void addChain(Chain chain)
          Adds a new Chain to this case.
 void addConcept(Concept con)
          Adds a new Concept to this case.
 void addStep(Step step)
          Adds a Step to this Case.
 void addStepDependency(Step before, Step after)
          This method adds dependencies between Steps and brings the Steps in a sequential order again, if necessary and if they have been in sequential order before adding the dependency.
 boolean containsDependency(Step before, Step after)
          Checks for a direct (explicitly added) dependency between the two Steps.
 Case copy()
           
 Chain createChain(java.lang.String name)
          Creates an empty Chain belonging to this Case.
 Chain createChain(java.lang.String name, java.util.Collection stepsAndChains)
          Creates a Chain that subsumes the given steps and chains.
 Concept createConcept(java.lang.String name, java.lang.String type)
          Creates an empty Concept belonging to this Case.
 Concept createConceptAndRelationsFromTables(java.lang.String tableName)
          This method creates a Columnset and Concept for the given table/view name, and also creates a Columnset and Concept for EVERY table that is referenced from the first one by a foreign key reference, and also creates an M4 Relation for those references.
 Concept createConceptFromColumnset(Columnset cs)
          Creates a Concept that belongs to this Case and is connected to the given Columnset.
 Concept createConceptFromTable(java.lang.String tableName)
          Creates a Concept that belongs to this Case and that directly models a database table or view with the given name.
 Relation createManyToManyRelation(java.lang.String relName, java.util.Collection fromConceptKeyAttribs, java.util.Collection toConceptKeyAttribs, java.lang.String crossTableName, java.util.Collection crossLinkToFromConceptNames, java.util.Collection crossLinkToToConceptNames)
          Creates a many-to-many relation.
 java.util.Collection createManyToManyRelationsFromCrossTable(java.lang.String crossTableName)
          Creates many-to-many relations with the given table name as cross table.
 Relation createOneToManyRelation(java.lang.String relName, java.util.Collection fromConceptKeyAttribs, java.util.Collection toConceptKeyAttribs)
          Creates a one-to-many relation.
 Step createStep(java.lang.String name)
          Creates an empty Step belonging to this Case.
 java.util.Collection getAllChains()
          Active getter of the Chains of this Case.
 java.util.Collection getAllConceptNames()
          Gets the names of all concepts.
 java.util.Collection getAllRelations()
          Returns all Relations that this Case has.
 java.util.Collection getAllStepNames()
          Returns a Collection with all Step names in the current Case.
 Chain getChainByName(java.lang.String name)
          Retrieve a Chain by its name.
 Concept getConcept(java.lang.String conceptName)
           
 java.util.Collection getConcepts()
          Active getter of the Concepts of this Case.
 java.util.Collection getDependentStepsFor(Step step)
          Gets a Collection of the stepIds that are dependent on the given step, ie must be compiled after the given step.
 java.util.Collection getDirectlyDependentSteps(Step step)
          Gets a Collection of the steps that are directly dependent on the given step.
 java.util.Collection getInputDataModel()
          Returns a collection of all concepts of type DB in this Case.
 int getNumberOfSteps()
           
 java.util.Map getOperatorToStepMap()
          Returns a map that maps operators that occur in this case to a collection of the steps in which they occur.
 Step getPredecessorIdOf(Step step)
          Gets the predecessor step, given the calculated sequential order.
 java.util.Iterator getReverseIterator()
           
 Step getStepByName(java.lang.String name)
          This method finds a Step related to this Case by the Step's M4 name
 Step getStepIdNo(int i)
          Gets the step i in sequential order.
 java.util.Iterator getStepIterator()
           
 java.util.Collection getStepsToCompileBefore(Step step, boolean ignoreCompiledStatusOfSteps)
          This method returns a Collection of all Steps on which the given Step is dependent.
 Step getSuccessorOf(Step step)
          Gets the successor step, given the calculated sequential order.
 java.lang.String getTheMode()
          Get the Case mode.
 java.util.Vector getTheSteps()
          Active getter
 java.util.Collection getTopLevelChains()
          Active getter of the Chains of this Case.
 int indexOfStep(Step step)
           
 void removeAllSteps()
          All Steps of a Case will be removed including their Parameters.
 boolean removeChain(Chain chain)
          Removes a Chain from this case.
 void removeChain(java.lang.String name)
          Remove a Chain by its name.
 boolean removeConcept(Concept con)
          Removes a Concept from this case.
 boolean removeStep(Step step)
          Removes a Step and all of its dependencies from this Case.
 void removeStep(java.lang.String name)
          The specified Step will be removed including its Parameters.
 boolean removeStepDependency(Step before, Step after)
          A dependency (or edge in graph terminology) between the two Steps is removed.
 void resolveChain(Chain toBeResolved)
          The given chain will be resolved if it is a top level chain and if it does not have any Steps, only subchains.
 void setTheMode(java.lang.String newMode)
          Set the Case mode.
 void store()
          Write all M4 data pertaining to this case through to the database.
 
Methods inherited from interface edu.udo.cs.miningmart.m4.M4Data
deleteSoon, getDocumentation, getValidName, isDirty, isWaitingForDelete, setDocumentation
 
Methods inherited from interface edu.udo.cs.miningmart.m4.M4Object
doPrint, doPrint, equals, executeBusinessSingleValueSqlRead, executeBusinessSingleValueSqlReadL, executeBusinessSqlRead, executeBusinessSqlWrite, executeM4SingleValueSqlRead, executeM4SingleValueSqlReadL, executeM4SqlRead, executeM4SqlWrite, getCasePrintObject, getId, getM4Db, getM4ObjectFromCache, getName, getNextM4SequenceValue, isNew, load, print, putM4ObjectToCache, replaceSpacesInName, setId, setName
 

Field Detail

TEST_MODE

public static final java.lang.String TEST_MODE
Constant that can be used to set the Case Mode to TEST

See Also:
Constant Field Values

DESIGN_MODE

public static final java.lang.String DESIGN_MODE
Constant that can be used to set the Case Mode to DESIGN

See Also:
Constant Field Values

FINAL_MODE

public static final java.lang.String FINAL_MODE
Constant that can be used to set the Case Mode to FINAL

See Also:
Constant Field Values
Method Detail

addStepDependency

public void addStepDependency(Step before,
                              Step after)
                       throws M4Exception
This method adds dependencies between Steps and brings the Steps in a sequential order again, if necessary and if they have been in sequential order before adding the dependency.

Parameters:
before - a Step part of this Case
after - a Step part of this Case and depending on Step before.
Throws:
M4Exception

containsDependency

public boolean containsDependency(Step before,
                                  Step after)
                           throws M4Exception
Checks for a direct (explicitly added) dependency between the two Steps.

Returns:
true if the second Step directly depends on the first one. If one of the Steps is not part of the Case then false is returned.
Throws:
M4Exception

removeStepDependency

public boolean removeStepDependency(Step before,
                                    Step after)
                             throws M4Exception
A dependency (or edge in graph terminology) between the two Steps is removed.

Parameters:
before - a Step part of this Case
after - a Step part of this Case, and depending on Step before
Returns:
true iff the dependency was found and could be removed
Throws:
M4Exception

setTheMode

public void setTheMode(java.lang.String newMode)
                throws M4Exception
Set the Case mode. Allowed constants are given by the public static variables TESTMODE and FINALMODE of this class.

Parameters:
newMode - The new case mode. Use the public static variables TESTMODE and FINALMODE of this class.
Throws:
M4Exception

getTheMode

public java.lang.String getTheMode()
Get the Case mode.

Returns:
A String with the value of one of the public static fields TESTMODE and FINALMODE of this class.

getStepIdNo

public Step getStepIdNo(int i)
                 throws M4Exception
Gets the step i in sequential order.

Returns:
Returns a step
Throws:
M4Exception

getNumberOfSteps

public int getNumberOfSteps()
                     throws M4Exception
Returns:
the number of steps of this case.
Throws:
M4Exception

getPredecessorIdOf

public Step getPredecessorIdOf(Step step)
                        throws M4Exception
Gets the predecessor step, given the calculated sequential order.

Parameters:
step - The step for which the predecessor is wanted.
Returns:
the predecessor step
Throws:
M4Exception

getSuccessorOf

public Step getSuccessorOf(Step step)
                    throws M4Exception
Gets the successor step, given the calculated sequential order.

Parameters:
step - The step for which the successor is wanted.
Returns:
the successor step
Throws:
M4Exception

indexOfStep

public int indexOfStep(Step step)
                throws M4Exception
Returns:
the index of the Step with the given Id, if part of this case. The result depends of the chosen (but fixed) sequential order of the Sequentializer!
Throws:
M4Exception

getStepIterator

public java.util.Iterator getStepIterator()
                                   throws M4Exception
Returns:
an Iterator providing the Steps of this Case. The order depends on the Sequentializer.
Throws:
M4Exception

getReverseIterator

public java.util.Iterator getReverseIterator()
                                      throws M4Exception
Returns:
an Iterator providing the Steps in reverse order. The order depends on the Sequentializer!
Throws:
M4Exception

getDependentStepsFor

public java.util.Collection getDependentStepsFor(Step step)
                                          throws M4Exception
Gets a Collection of the stepIds that are dependent on the given step, ie must be compiled after the given step.

Returns:
The dependent steps as a Collection.
Throws:
M4Exception

getStepsToCompileBefore

public java.util.Collection getStepsToCompileBefore(Step step,
                                                    boolean ignoreCompiledStatusOfSteps)
                                             throws M4Exception
This method returns a Collection of all Steps on which the given Step is dependent. That means, all Steps are returned that must be compiled before the given Step can be compiled. By the parameter ignoreCompiledStatusOfSteps, one can specify whether the method considers only the graph structure of M4 Step dependencies, and ignores whether some of the Steps to be returned have already been compiled (and thus would not have to be compiled again) - or whether this compilation status of Steps should be taken into account. In the latter case, the search for predecessors of the given Steps ends, on every path that leads to the given Step, at the last Step that is already compiled.

Parameters:
step - the Step whose preceding graph is returned
ignoreCompiledStatusOfSteps - if TRUE, *all* Steps that lead to the given Step are returned; if FALSE, only those starting at the last compiled Step on each path that leads to the given Step are returned.
Returns:
a Collection of all Steps that must, in principle, be compiled before the given Step can be compiled
Throws:
M4Exception

getDirectlyDependentSteps

public java.util.Collection getDirectlyDependentSteps(Step step)
                                               throws M4Exception
Gets a Collection of the steps that are directly dependent on the given step. This is useful for the HCI to just visualize the explicitly stored dependencies.

Parameters:
step - The step for which the dependent steps are wanted.
Returns:
The dependent steps as a Collection or null, if the specified Step is not found.
Throws:
M4Exception

getAllConceptNames

public java.util.Collection getAllConceptNames()
                                        throws M4Exception
Gets the names of all concepts.

Returns:
The names (String).
Throws:
M4Exception

getConcepts

public java.util.Collection getConcepts()
                                 throws M4Exception
Active getter of the Concepts of this Case.

Returns:
a Collection of Concepts
Throws:
M4Exception

getInputDataModel

public java.util.Collection getInputDataModel()
                                       throws M4Exception
Returns a collection of all concepts of type DB in this Case.

Returns:
a Collection of Concepts
Throws:
M4Exception

addConcept

public void addConcept(Concept con)
                throws M4Exception
Adds a new Concept to this case.

Parameters:
con - the new Concept
Throws:
M4Exception

removeConcept

public boolean removeConcept(Concept con)
                      throws M4Exception
Removes a Concept from this case.

Parameters:
con - the Concept to be removed
Returns:
true if Concept was found and could be removed
Throws:
M4Exception

getAllChains

public java.util.Collection getAllChains()
                                  throws M4Exception
Active getter of the Chains of this Case. Attention: It returns ALL chains of this Case, including subchains of subchains etc.! Compare to method getTopLevelChains.

Returns:
a Collection of Chains
Throws:
M4Exception

getTopLevelChains

public java.util.Collection getTopLevelChains()
                                       throws M4Exception
Active getter of the Chains of this Case. Attention: It returns ONLY the top-level chains of this Case, that is, the Chains that do not have a parent chain. Compare to method getAllChains.

Returns:
a Collection of Chains
Throws:
M4Exception

getChainByName

public Chain getChainByName(java.lang.String name)
                     throws M4Exception
Retrieve a Chain by its name.

Parameters:
name - the Name
Throws:
M4Exception

removeChain

public void removeChain(java.lang.String name)
                 throws M4Exception
Remove a Chain by its name.

Parameters:
name - the Name
Throws:
M4Exception

addChain

public void addChain(Chain chain)
              throws M4Exception
Adds a new Chain to this case. It does not have to be a top level chain (ie a chain without a parent chain).

Parameters:
chain - the new Chain
Throws:
M4Exception

removeChain

public boolean removeChain(Chain chain)
                    throws M4Exception
Removes a Chain from this case.

Parameters:
chain - the Chain to be removed
Returns:
true if Chain was found and could be removed
Throws:
M4Exception

getStepByName

public Step getStepByName(java.lang.String name)
                   throws M4Exception
This method finds a Step related to this Case by the Step's M4 name

Parameters:
name - the name of the Step object
Returns:
the Step or null
Throws:
M4Exception

getTheSteps

public java.util.Vector getTheSteps()
                             throws M4Exception
Active getter

Returns:
a Collection of all Steps of this Case
Throws:
M4Exception

addStep

public void addStep(Step step)
             throws M4Exception
Adds a Step to this Case.

Parameters:
step - the Step to be added
Throws:
M4Exception

removeStep

public boolean removeStep(Step step)
                   throws M4Exception
Removes a Step and all of its dependencies from this Case.

Parameters:
step - the Step to be added
Throws:
M4Exception

copy

public Case copy()
          throws M4Exception
Throws:
M4Exception

createStep

public Step createStep(java.lang.String name)
                throws M4Exception
Creates an empty Step belonging to this Case. The name of the Step should be unique within the Case.

Throws:
CreateException - when an error occurs during creation of the object.
NameExistsException - when the provided name already exists.
M4Exception

getAllStepNames

public java.util.Collection getAllStepNames()
                                     throws M4Exception
Returns a Collection with all Step names in the current Case.

Throws:
M4Exception

removeStep

public void removeStep(java.lang.String name)
                throws M4Exception
The specified Step will be removed including its Parameters. Concepts and BaseAttributes of types BASE and DB however will not be removed.

Throws:
M4Exception

removeAllSteps

public void removeAllSteps()
                    throws M4Exception
All Steps of a Case will be removed including their Parameters. Concepts and BaseAttributes of types BASE and DB however will not be removed.

Throws:
M4Exception

createChain

public Chain createChain(java.lang.String name)
                  throws M4Exception
Creates an empty Chain belonging to this Case. The name of the Chain should be unique within the Case.

Parameters:
name - the name to be given to the new chain
Returns:
the created chain
Throws:
M4Exception

createChain

public Chain createChain(java.lang.String name,
                         java.util.Collection stepsAndChains)
                  throws M4Exception
Creates a Chain that subsumes the given steps and chains. It will not be given any parent chain, so it will be a top level chain in this Case.

Parameters:
name - the name to be given to the new chain
stepsAndChains - a Collection of Steps and/or Chains.
Returns:
the created chain
Throws:
M4Exception

resolveChain

public void resolveChain(Chain toBeResolved)
                  throws M4Exception
The given chain will be resolved if it is a top level chain and if it does not have any Steps, only subchains. Otherwise an M4Exception is thrown. The subchains of the given chain will be new top-level chains of this Case.

Throws:
M4Exception

createConcept

public Concept createConcept(java.lang.String name,
                             java.lang.String type)
                      throws M4Exception
Creates an empty Concept belonging to this Case. The name of the Concept must be unique within the Case.

Parameters:
name - the name for the concept to be created
type - the type of the concept (see Concept.TYPE_...)
Throws:
M4Exception

createConceptFromTable

public Concept createConceptFromTable(java.lang.String tableName)
                               throws M4Exception
Creates a Concept that belongs to this Case and that directly models a database table or view with the given name. The concept will have exactly the given name. For each column of the table/view a BaseAttribute is created and attached to the Concept. The given name must be a valid name of a database table or view in the current business data schema, otherwise an exception is thrown.

Parameters:
tableName - the name of a table or view in the business schema
Throws:
M4Exception

createConceptFromColumnset

public Concept createConceptFromColumnset(Columnset cs)
                                   throws M4Exception
Creates a Concept that belongs to this Case and is connected to the given Columnset. The concept directly reflects the Columnset, that is, its name and the names of the BaseAttributes are taken from the Columnset and its Columns.

Parameters:
cs - the given Columnset
Returns:
the new Concept
Throws:
M4Exception

createOneToManyRelation

public Relation createOneToManyRelation(java.lang.String relName,
                                        java.util.Collection fromConceptKeyAttribs,
                                        java.util.Collection toConceptKeyAttribs)
                                 throws M4Exception
Creates a one-to-many relation. The name must be valid for this Case. There must be equally many Features in the from/to key attribute collections.

Parameters:
relName - a valid name for a new Relation in this Case
fromConceptKeyAttribs - a Collection of the Features that make up the key attributes in the FromConcept
toConceptKeyAttribs - a Collection of the Features that make up the key attributes in the ToConcept
Returns:
the newly created Relation
Throws:
M4Exception

createManyToManyRelation

public Relation createManyToManyRelation(java.lang.String relName,
                                         java.util.Collection fromConceptKeyAttribs,
                                         java.util.Collection toConceptKeyAttribs,
                                         java.lang.String crossTableName,
                                         java.util.Collection crossLinkToFromConceptNames,
                                         java.util.Collection crossLinkToToConceptNames)
                                  throws M4Exception
Creates a many-to-many relation. The name must be valid for this Case. There must be equally many Features in the from/to key attribute collections as there are names in the from/to cross link name collections.

Parameters:
relName - a valid name for a new Relation in this Case
fromConceptKeyAttribs - a Collection of the Features that make up the key attributes in the FromConcept
toConceptKeyAttribs - a Collection of the Features that make up the key attributes in the ToConcept
crossTableName - the name of the table in the business data schema that serves as the cross table
crossLinkToFromConceptNames - a Collection with the names of the cross table columns that provide the foreign key to the primary key of the FromConcept
crossLinkToToConceptNames - a Collection with the names of the cross table columns that provide the foreign key to the primary key of the ToConcept
Returns:
the newly created Relation
Throws:
M4Exception

createManyToManyRelationsFromCrossTable

public java.util.Collection createManyToManyRelationsFromCrossTable(java.lang.String crossTableName)
                                                             throws M4Exception
Creates many-to-many relations with the given table name as cross table. This only works if the foreign key information is stored in the database.

Parameters:
crossTableName -
Returns:
Throws:
M4Exception

createConceptAndRelationsFromTables

public Concept createConceptAndRelationsFromTables(java.lang.String tableName)
                                            throws M4Exception
This method creates a Columnset and Concept for the given table/view name, and also creates a Columnset and Concept for EVERY table that is referenced from the first one by a foreign key reference, and also creates an M4 Relation for those references. Concepts and Columnsets for the other tables/views are only created if no such object with the same name exists yet in the M4 cache. At the moment only one-to-many relations are created!

Parameters:
tableName - the given table name
Returns:
the first Concept, from which the referenced Concepts can be found by following the M4 Relations.
Throws:
M4Exception

getConcept

public Concept getConcept(java.lang.String conceptName)
                   throws M4Exception
Throws:
M4Exception

store

public void store()
           throws M4Exception
Write all M4 data pertaining to this case through to the database.

Throws:
M4Exception

getAllRelations

public java.util.Collection getAllRelations()
                                     throws M4Exception
Returns all Relations that this Case has.

Returns:
a Collection of Relations
Throws:
M4Exception

getOperatorToStepMap

public java.util.Map getOperatorToStepMap()
                                   throws M4Exception
Returns a map that maps operators that occur in this case to a collection of the steps in which they occur.

Returns:
a map from operators to collections of steps
Throws:
M4Exception


Copyright © 2001-2005