edu.udo.cs.miningmart.m4.core
Class Operator

java.lang.Object
  extended byedu.udo.cs.miningmart.m4.core.M4Object
      extended byedu.udo.cs.miningmart.m4.core.M4Data
          extended byedu.udo.cs.miningmart.m4.core.Operator
All Implemented Interfaces:
java.lang.Comparable, M4Data, M4Object, M4Table, Operator, java.io.Serializable, XmlInfo

public class Operator
extends M4Data
implements XmlInfo, Operator

This is the class representing the OPERATOR_T table of the M4 schema. Operator constraints are also accessible from Operator objects. The top class of the executable operators of the compiler is ExecutableOperator.

Version:
$Id: Operator.java,v 1.3 2006/04/11 14:10:14 euler Exp $
Author:
Martin Scholz
See Also:
Serialized Form

Field Summary
static java.lang.String ATTRIB_OPERATOR_ID
          db level: name of the operator id attribute
static java.lang.String ATTRIB_OPERATOR_IS_LOOPABLE
          db level: name of the attribute indicating if it is a loopable operator
static java.lang.String ATTRIB_OPERATOR_IS_MANUAL
          db level: name of the attribute indicating if it is a manual operator
static java.lang.String ATTRIB_OPERATOR_IS_MULTISTEPABLE
          db level: name of the attribute indicating if it is a multi-stepable operator
static java.lang.String ATTRIB_OPERATOR_NAME
          db level: name of the operator name attribute
static java.lang.String ATTRIB_OPERATOR_REALIZED
          db level: name of the attribute for operator realization
protected  boolean loopable
           
static java.lang.String M4_TABLE_NAME
          The name of the corresponding M4 table.
static M4Info m4Info
          Cache for getM4Info()
protected  boolean manual
           
protected  java.lang.String realize
           
protected  boolean stepable
           
 
Fields inherited from class edu.udo.cs.miningmart.m4.core.M4Data
myDocumentation
 
Fields inherited from class edu.udo.cs.miningmart.m4.core.M4Object
myId, myName
 
Fields inherited from interface edu.udo.cs.miningmart.m4.utils.XmlInfo
M4_XML_VERSION, TAG_COLLECTION, TAG_DOUBLE, TAG_INTEGER, TAG_LONG, TAG_M4_ID, TAG_SHORT, TAG_STRING, TAG_XML_ID
 
Fields inherited from interface edu.udo.cs.miningmart.m4.utils.M4Table
NOT_NULL
 
Constructor Summary
Operator(DB db)
          Constructor.
 
Method Summary
 void addAssertion(Assertion assertion)
           
 void addCondition(Condition condition)
           
 void addConstraint(Constraint constraint)
           
 void addOpParam(OpParam opParam)
          Add an OpParam object to this operator's specification.
 Assertion createAssertion(java.lang.String type, java.lang.String object1, java.lang.String object2, java.lang.String text)
          Creates a new Assertion for this Operator.
 Condition createCondition(java.lang.String type, java.lang.String object1, java.lang.String object2, java.lang.String text)
          Creates a new Condition for this Operator.
 Constraint createConstraint(java.lang.String type, java.lang.String object1, java.lang.String object2, java.lang.String text)
          Creates a new Constraint for this Operator.
 OpParam createOperatorParameter(java.lang.String name, int minNrOfArgs, int maxNrOfArgs, java.lang.String ioType, java.lang.String parameterType, java.lang.String text)
          Creates a new OperatorParameter for this Operator.
 java.util.Collection getAllInputOperatorParameters()
          Returns all OperatorParameters of type INPUT.
 java.util.Collection getAllOperatorParameters()
           
 java.util.Collection getAllOutputOperatorParameters()
          Returns all OperatorParameters of type OUTPUT.
 java.util.Collection getAssertions()
           
 java.util.Collection getConditions()
           
 java.util.Collection getConstraints()
           
 java.util.Collection getCoordinatedParameterArrays()
          An operator can have parameter arrays whose values must be coordinated positionwise.
 java.util.Collection getDependentObjects()
          This method is part of the XML-serialization and needs to be implemented by all M4Data sub-classes that need to be serialized.
 java.lang.String getIdAttributeName()
           
 java.lang.String getLoopable()
          "Getter" method.
 M4Info getM4Info()
           
 java.lang.String getM4TableName()
           
 java.lang.String getManual()
          "Getter" method.
protected  java.util.Collection getObjectsInNamespace(java.lang.Class typeOfObjects)
          This method returns the objects of the specified type that form a namespace in the scope of this M4Data object.
 OpParam getOperatorParameter(java.lang.String name)
           
 java.util.Collection getOperatorParametersByType(java.lang.String type)
           
 OpParam getOpParam(java.lang.String name)
          Returns the OpParam with the given name, if it exists, and NULL otherwise.
 java.util.Collection getOpParams()
          Active getter for this operator's OpParam's.
 java.util.Iterator getOpParamsIterator()
          Get an iterator.
 java.lang.String getRealize()
          Getter method.
 java.lang.String getStepable()
          "Getter" method.
 M4Info getXmlInfo()
           
 boolean isLoopable()
          "Getter" method.
 boolean isManual()
          "Getter" method.
 boolean isStepable()
          "Getter" method.
 void print()
          Method to print data about this M4Object.
protected  void removeAllM4References()
          This method needs to be implemented by all M4Data objects.
 void removeAllOperatorParameters()
          Removes all OperatorParameters of this Operator.
 boolean removeAssertion(Assertion assertion)
           
 boolean removeCondition(Condition condition)
           
 boolean removeConstraint(Constraint constraint)
           
 void removeOperatorParameter(java.lang.String name)
          Remove the specified OperatorParameter for this Operator.
 void removeOperatorParameterByType(java.lang.String type)
          Removes all OperatorParameters of this Operator of the specified type.
 boolean removeOpParam(OpParam opParam)
          Remove an OpParam object from this operator's specification.
 void setLoopable(boolean l)
          Setter method.
 void setLoopable(java.lang.String loopable)
          Setter method.
 void setManual(boolean m)
          Setter method.
 void setManual(java.lang.String manual)
          Setter method.
 void setRealize(java.lang.String r)
          Setter method.
 void setStepable(boolean s)
          Setter method.
 void setStepable(java.lang.String stepable)
          Setter method.
 
Methods inherited from class edu.udo.cs.miningmart.m4.core.M4Data
deleteLocal, deleteSoon, exportLocal, genericGetter, genericSetter, getDocumentation, getObjectsReferencingMe, getObjectsReferencingMe, getObjectTag, getValidName, getXmlIdTag, getXmlVersion, hasDeleteStatus, importLocal, isDirty, isWaitingForDelete, primitiveGetDocObject, primitiveSetDocObject, readFromDb, readFromDbLocal, removeDocObject, removeFromDb, removeSetFromDb, setDirty, setDocumentation, setId, setName, storeLocal, updateObjectsFromTable
 
Methods inherited from class edu.udo.cs.miningmart.m4.core.M4Object
compareTo, doPrint, doPrint, equals, executeBusinessSingleValueSqlRead, executeBusinessSingleValueSqlReadL, executeBusinessSqlRead, executeBusinessSqlWrite, executeM4SingleValueSqlRead, executeM4SingleValueSqlReadL, executeM4SqlRead, executeM4SqlWrite, getCasePrintObject, getId, getM4Db, getM4ObjectFromCache, getName, getNextM4SequenceValue, isNew, load, putM4ObjectToCache, replaceSpacesInName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.udo.cs.miningmart.m4.utils.XmlInfo
doPrint, doPrint, exportLocal, genericGetter, genericSetter, getObjectTag, getXmlIdTag, getXmlVersion, importLocal
 
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, putM4ObjectToCache, replaceSpacesInName, setId, setName
 

Field Detail

M4_TABLE_NAME

public static final java.lang.String M4_TABLE_NAME
The name of the corresponding M4 table.

See Also:
Constant Field Values

ATTRIB_OPERATOR_ID

public static final java.lang.String ATTRIB_OPERATOR_ID
db level: name of the operator id attribute

See Also:
Constant Field Values

ATTRIB_OPERATOR_NAME

public static final java.lang.String ATTRIB_OPERATOR_NAME
db level: name of the operator name attribute

See Also:
Constant Field Values

ATTRIB_OPERATOR_IS_MANUAL

public static final java.lang.String ATTRIB_OPERATOR_IS_MANUAL
db level: name of the attribute indicating if it is a manual operator

See Also:
Constant Field Values

ATTRIB_OPERATOR_IS_LOOPABLE

public static final java.lang.String ATTRIB_OPERATOR_IS_LOOPABLE
db level: name of the attribute indicating if it is a loopable operator

See Also:
Constant Field Values

ATTRIB_OPERATOR_IS_MULTISTEPABLE

public static final java.lang.String ATTRIB_OPERATOR_IS_MULTISTEPABLE
db level: name of the attribute indicating if it is a multi-stepable operator

See Also:
Constant Field Values

ATTRIB_OPERATOR_REALIZED

public static final java.lang.String ATTRIB_OPERATOR_REALIZED
db level: name of the attribute for operator realization

See Also:
Constant Field Values

m4Info

public static M4Info m4Info
Cache for getM4Info()


loopable

protected boolean loopable

stepable

protected boolean stepable

manual

protected boolean manual

realize

protected java.lang.String realize
Constructor Detail

Operator

public Operator(DB db)
Constructor.

Parameters:
db - the reference to the Case's DB object.
Method Detail

getM4TableName

public java.lang.String getM4TableName()
Specified by:
getM4TableName in interface M4Table
See Also:
M4Table.getM4TableName()

getIdAttributeName

public java.lang.String getIdAttributeName()
Specified by:
getIdAttributeName in interface M4Table
See Also:
M4Table.getIdAttributeName()

getM4Info

public M4Info getM4Info()
Specified by:
getM4Info in interface M4Table
See Also:
M4Table.getM4Info()

getXmlInfo

public M4Info getXmlInfo()
Specified by:
getXmlInfo in interface XmlInfo
Returns:
a M4Info object with the information of all XML fields of this object.
See Also:
XmlInfo.getXmlInfo()

getOpParamsIterator

public java.util.Iterator getOpParamsIterator()
                                       throws M4Exception
Get an iterator.

Specified by:
getOpParamsIterator in interface Operator
Returns:
an Iterator for the parameters stored in table OP_PARAM_T, represented as objects of type OpParam.
Throws:
M4Exception

getObjectsInNamespace

protected java.util.Collection getObjectsInNamespace(java.lang.Class typeOfObjects)
                                              throws M4Exception
Description copied from class: M4Data
This method returns the objects of the specified type that form a namespace in the scope of this M4Data object. For example, a Concept's namespace for the type BaseAttribute is the Collection of all BaseAttributes for this Concept. Many M4Data objects never have a namespace, they return null. If a namespace could exist but doesn't, an empty Collection is returned.

Specified by:
getObjectsInNamespace in class M4Data
Parameters:
typeOfObjects - the type of objects that form the namespace
Returns:
a Collection of objects of type typeOfObjects, or null.
Throws:
M4Exception
See Also:
M4Data.getObjectsInNamespace(Class)

setRealize

public void setRealize(java.lang.String r)
Setter method.

Specified by:
setRealize in interface Operator
Parameters:
r - the new value

getRealize

public java.lang.String getRealize()
Getter method.

Specified by:
getRealize in interface Operator
Returns:
the value

setLoopable

public void setLoopable(boolean l)
Setter method.

Specified by:
setLoopable in interface Operator
Parameters:
l - the new value

setLoopable

public void setLoopable(java.lang.String loopable)
Setter method.

Specified by:
setLoopable in interface Operator
Parameters:
loopable - the new value in the database String representation

isLoopable

public boolean isLoopable()
"Getter" method.

Specified by:
isLoopable in interface Operator
Returns:
the value

getLoopable

public java.lang.String getLoopable()
"Getter" method.

Specified by:
getLoopable in interface Operator
Returns:
the value in database String representation

setManual

public void setManual(boolean m)
Setter method.

Specified by:
setManual in interface Operator
Parameters:
m - the new value

setManual

public void setManual(java.lang.String manual)
Setter method.

Specified by:
setManual in interface Operator
Parameters:
manual - the new value in the database String representation

isManual

public boolean isManual()
"Getter" method.

Specified by:
isManual in interface Operator
Returns:
the value

getManual

public java.lang.String getManual()
"Getter" method.

Specified by:
getManual in interface Operator
Returns:
the value in database String representation

setStepable

public void setStepable(boolean s)
Setter method.

Specified by:
setStepable in interface Operator
Parameters:
s - the new value

setStepable

public void setStepable(java.lang.String stepable)
Setter method.

Specified by:
setStepable in interface Operator
Parameters:
stepable - the new value in the database String representation

isStepable

public boolean isStepable()
"Getter" method.

Specified by:
isStepable in interface Operator
Returns:
the value

getStepable

public java.lang.String getStepable()
"Getter" method.

Specified by:
getStepable in interface Operator
Returns:
the value in database String representation

getOpParams

public java.util.Collection getOpParams()
                                 throws M4Exception
Active getter for this operator's OpParam's.

Specified by:
getOpParams in interface Operator
Returns:
the Collection of OpParams for this operator
Throws:
M4Exception

addOpParam

public void addOpParam(OpParam opParam)
                throws M4Exception
Add an OpParam object to this operator's specification.

Specified by:
addOpParam in interface Operator
Parameters:
opParam - the OpParam to be added
Throws:
M4Exception

removeOpParam

public boolean removeOpParam(OpParam opParam)
                      throws M4Exception
Remove an OpParam object from this operator's specification.

Specified by:
removeOpParam in interface Operator
Parameters:
opParam - the OpParam to be removed
Returns:
true iff the object was part of this Operator's specification and could be removed.
Throws:
M4Exception

getAssertions

public java.util.Collection getAssertions()
                                   throws M4Exception
Specified by:
getAssertions in interface Operator
Throws:
M4Exception

getConditions

public java.util.Collection getConditions()
                                   throws M4Exception
Specified by:
getConditions in interface Operator
Throws:
M4Exception

getConstraints

public java.util.Collection getConstraints()
                                    throws M4Exception
Specified by:
getConstraints in interface Operator
Throws:
M4Exception

addAssertion

public void addAssertion(Assertion assertion)
                  throws M4Exception
Specified by:
addAssertion in interface Operator
Parameters:
assertion - an Assertion to be added
Throws:
M4Exception

addCondition

public void addCondition(Condition condition)
                  throws M4Exception
Specified by:
addCondition in interface Operator
Parameters:
condition - a Condition to be added
Throws:
M4Exception

addConstraint

public void addConstraint(Constraint constraint)
                   throws M4Exception
Specified by:
addConstraint in interface Operator
Parameters:
constraint - a Constraint to be added
Throws:
M4Exception

removeAssertion

public boolean removeAssertion(Assertion assertion)
                        throws M4Exception
Specified by:
removeAssertion in interface Operator
Parameters:
assertion - an Assertion to be removed
Throws:
M4Exception

removeCondition

public boolean removeCondition(Condition condition)
                        throws M4Exception
Specified by:
removeCondition in interface Operator
Parameters:
condition - a Condition to be removed
Throws:
M4Exception

removeConstraint

public boolean removeConstraint(Constraint constraint)
                         throws M4Exception
Specified by:
removeConstraint in interface Operator
Parameters:
constraint - a Constraint to be removed
Throws:
M4Exception

createAssertion

public Assertion createAssertion(java.lang.String type,
                                 java.lang.String object1,
                                 java.lang.String object2,
                                 java.lang.String text)
                          throws M4Exception
Description copied from interface: Operator
Creates a new Assertion for this Operator.

Specified by:
createAssertion in interface Operator
Throws:
M4Exception
See Also:
createAssertion(String, String, String, String)

createConstraint

public Constraint createConstraint(java.lang.String type,
                                   java.lang.String object1,
                                   java.lang.String object2,
                                   java.lang.String text)
                            throws M4Exception
Description copied from interface: Operator
Creates a new Constraint for this Operator.

Specified by:
createConstraint in interface Operator
Throws:
M4Exception
See Also:
createConstraint(String, String, String, String)

createCondition

public Condition createCondition(java.lang.String type,
                                 java.lang.String object1,
                                 java.lang.String object2,
                                 java.lang.String text)
                          throws M4Exception
Description copied from interface: Operator
Creates a new Condition for this Operator.

Specified by:
createCondition in interface Operator
Throws:
M4Exception
See Also:
createCondition(String, String, String, String)

createOperatorParameter

public OpParam createOperatorParameter(java.lang.String name,
                                       int minNrOfArgs,
                                       int maxNrOfArgs,
                                       java.lang.String ioType,
                                       java.lang.String parameterType,
                                       java.lang.String text)
                                throws M4Exception
Description copied from interface: Operator
Creates a new OperatorParameter for this Operator.

Specified by:
createOperatorParameter in interface Operator
Throws:
M4Exception
See Also:
createOperatorParameter(String, int, int, String, String, String)

getOperatorParameter

public OpParam getOperatorParameter(java.lang.String name)
                             throws M4Exception
Throws:
M4Exception
See Also:
getOperatorParameter(String)

removeOperatorParameter

public void removeOperatorParameter(java.lang.String name)
                             throws M4Exception
Description copied from interface: Operator
Remove the specified OperatorParameter for this Operator.

Specified by:
removeOperatorParameter in interface Operator
Throws:
M4Exception
See Also:
removeOperatorParameter(String)

removeAllOperatorParameters

public void removeAllOperatorParameters()
                                 throws M4Exception
Description copied from interface: Operator
Removes all OperatorParameters of this Operator. They are also removed from the M4 Schema.

Specified by:
removeAllOperatorParameters in interface Operator
Throws:
M4Exception
See Also:
removeAllOperatorParameters()

removeOperatorParameterByType

public void removeOperatorParameterByType(java.lang.String type)
                                   throws M4Exception
Description copied from interface: Operator
Removes all OperatorParameters of this Operator of the specified type. They are also removed from the M4 Schema.

Specified by:
removeOperatorParameterByType in interface Operator
Throws:
M4Exception
See Also:
removeOperatorParameterByType(String)

getAllOperatorParameters

public java.util.Collection getAllOperatorParameters()
                                              throws M4Exception
Throws:
M4Exception
See Also:
getAllOperatorParameters()

getOperatorParametersByType

public java.util.Collection getOperatorParametersByType(java.lang.String type)
                                                 throws M4Exception
Specified by:
getOperatorParametersByType in interface Operator
Throws:
M4Exception
See Also:
getOperatorParametersByType(String)

getAllInputOperatorParameters

public java.util.Collection getAllInputOperatorParameters()
                                                   throws M4Exception
Description copied from interface: Operator
Returns all OperatorParameters of type INPUT.

Specified by:
getAllInputOperatorParameters in interface Operator
Throws:
M4Exception
See Also:
getAllInputOperatorParameters()

getAllOutputOperatorParameters

public java.util.Collection getAllOutputOperatorParameters()
                                                    throws M4Exception
Description copied from interface: Operator
Returns all OperatorParameters of type OUTPUT.

Specified by:
getAllOutputOperatorParameters in interface Operator
Throws:
M4Exception
See Also:
getAllOutputOperatorParameters()

getOpParam

public OpParam getOpParam(java.lang.String name)
                   throws M4Exception
Description copied from interface: Operator
Returns the OpParam with the given name, if it exists, and NULL otherwise.

Specified by:
getOpParam in interface Operator
Parameters:
name - the name
Returns:
an OpParam or null
Throws:
M4Exception

getCoordinatedParameterArrays

public java.util.Collection getCoordinatedParameterArrays()
                                                   throws M4Exception
Description copied from interface: Operator
An operator can have parameter arrays whose values must be coordinated positionwise. This method returns all collections of such arrays. That is, it returns a Collection of Collections of OpParam objects. Each of the OpParam objects represents a parameter array that belongs to this operator. All parameter arrays within one of the returned Collections must be coordinated positionwise. If no coordinated parameter arrays exist, an empty collection is returned.

Specified by:
getCoordinatedParameterArrays in interface Operator
Returns:
a Collection of Collections of OpParam objects
Throws:
M4Exception
See Also:
Operator.getCoordinatedParameterArrays()

print

public void print()
Description copied from interface: M4Object
Method to print data about this M4Object.

Specified by:
print in interface M4Object
Specified by:
print in class M4Object

removeAllM4References

protected void removeAllM4References()
                              throws M4Exception
Description copied from class: M4Data
This method needs to be implemented by all M4Data objects. It has to remove all references to other M4Objects.

Specified by:
removeAllM4References in class M4Data
Throws:
M4Exception
See Also:
M4Data.removeAllM4References()

getDependentObjects

public java.util.Collection getDependentObjects()
                                         throws M4Exception
Description copied from class: M4Data
This method is part of the XML-serialization and needs to be implemented by all M4Data sub-classes that need to be serialized.

Specified by:
getDependentObjects in interface XmlInfo
Overrides:
getDependentObjects in class M4Data
Returns:
a Collection of all M4Data Java objects holding a foreign key reference to this object. This method must never return null.
Throws:
M4Exception
See Also:
M4Data.getDependentObjects()


Copyright © 2001-2005