ix.icore.domain
Class Refinement

java.lang.Object
  extended by ix.icore.AbstractAnnotatedObject
      extended by ix.icore.AbstractIXObject
          extended by ix.icore.domain.Refinement
All Implemented Interfaces:
Annotated, Named, IXObject, java.io.Serializable, java.lang.Cloneable

public class Refinement
extends AbstractIXObject
implements Named, java.lang.Cloneable

A Refinement describes one way to carry out a possible activity in a process being modelled.

See Also:
Serialized Form

Nested Class Summary
static class Refinement.NameComparator
          A comparator that puts refinements in alphabetical order by name.
 
Field Summary
protected  ix.icore.domain.ListOfConstraint constraints
           
protected  ix.icore.ListOfIssue issues
           
protected  java.lang.String name
           
protected  ix.icore.domain.ListOfNodeSpec nodes
           
protected  ix.icore.domain.ListOfOrdering orderings
           
protected  LList pattern
           
static Symbol S_COMPUTE
           
static Symbol S_CONDITION
           
static Symbol S_EFFECT
           
static Symbol S_MULTIPLE_ANSWER
           
static Symbol S_SELF
           
static Symbol S_WORLD_STATE
           
protected  ix.icore.domain.ListOfVariableDeclaration variableDeclarations
           
 
Fields inherited from class ix.icore.AbstractAnnotatedObject
annotationListeners, annotations
 
Constructor Summary
Refinement()
           
Refinement(java.lang.String name, LList pattern)
           
 
Method Summary
 void checkConsistency()
          Checks the consistency of this refinement.
protected  void checkInputsAndOutputs()
           
protected  void checkNodeRefs()
          Checks that every node mentioned in a constraint is defined in this refinement.
protected  void checkParametersAgainstConstraints(Symbol key, java.util.List constraints)
           
protected  void checkVariableRefs()
          Checks that the set of variables declared in this refinement and the set of variables referred to (used) in this refinement are the same.
 java.lang.Object clone()
           
 java.lang.String getComments()
           
 ix.icore.domain.ListOfConstraint getConditionConstraints()
           
 ix.icore.domain.ListOfPatternAssignment getConditions()
           
 ix.icore.domain.ListOfConstraint getConstraints()
           
 ix.icore.domain.ListOfConstraint getConstraints(Symbol type, Symbol relation)
           
 java.util.SortedSet getDeclaredVariables()
          Returns a set containing the ItemVars declared with this refinement.
 ix.icore.domain.ListOfConstraint getEffectConstraints()
           
 ix.icore.domain.ListOfPatternAssignment getEffects()
           
 ix.icore.domain.ListOfConstraint getFilterConstraints()
           
 ix.icore.ListOfIssue getIssues()
           
 java.lang.String getName()
           
 ix.icore.domain.ListOfNodeSpec getNodes()
           
 ix.icore.domain.ListOfOrdering getOrderings()
           
 ix.icore.domain.ListOfConstraint getOtherConstraints()
           
 LList getPattern()
           
 ix.icore.domain.ListOfVariableDeclaration getVariableDeclarations()
           
 java.util.SortedSet getVariablesUsed()
          Returns a set containing the ItemVars used within this refinement.
 Refinement instantiate(MatchEnv env)
          Returns a copy of this refinement in which each ItemVar that has a value in the MatchEnv has been replaced by that value.
 Refinement instantiate(MatchEnv env, Function1 ifUnbound)
          Returns a copy of this refinement in which each ItemVar that has a value in the MatchEnv has been replaced by that value.
protected  boolean isDeclared(ItemVar v)
          Returns true iff this specified variable is declared in this refinement.
 void setConstraints(java.util.List constraints)
           
 void setConstraints(ix.icore.domain.ListOfConstraint cs)
           
 void setIssues(java.util.List issues)
           
 void setIssues(ix.icore.ListOfIssue issues)
           
 void setName(java.lang.String name)
           
 void setNodes(java.util.List nodes)
           
 void setNodes(ix.icore.domain.ListOfNodeSpec nodes)
           
 void setOrderings(java.util.List orderings)
           
 void setOrderings(ix.icore.domain.ListOfOrdering orderings)
           
 void setPattern(LList pattern)
           
 void setVariableDeclarations(java.util.List dcls)
           
 void setVariableDeclarations(ix.icore.domain.ListOfVariableDeclaration variableDeclarations)
           
 java.lang.String toString()
           
 
Methods inherited from class ix.icore.AbstractAnnotatedObject
addAnnotationListener, annMap, clearAnnotations, fireSetAnnotation, getAnnotation, getAnnotations, makeAnnMap, removeAnnotation, setAnnotation, setAnnotations, setComments, takeAnnotations
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ix.icore.Annotated
addAnnotationListener, clearAnnotations, fireSetAnnotation, getAnnotation, getAnnotations, removeAnnotation, setAnnotation, setAnnotations, takeAnnotations
 

Field Detail

name

protected java.lang.String name

pattern

protected LList pattern

variableDeclarations

protected ix.icore.domain.ListOfVariableDeclaration variableDeclarations

nodes

protected ix.icore.domain.ListOfNodeSpec nodes

orderings

protected ix.icore.domain.ListOfOrdering orderings

constraints

protected ix.icore.domain.ListOfConstraint constraints

issues

protected ix.icore.ListOfIssue issues

S_WORLD_STATE

public static final Symbol S_WORLD_STATE

S_CONDITION

public static final Symbol S_CONDITION

S_EFFECT

public static final Symbol S_EFFECT

S_COMPUTE

public static final Symbol S_COMPUTE

S_MULTIPLE_ANSWER

public static final Symbol S_MULTIPLE_ANSWER

S_SELF

public static final Symbol S_SELF
Constructor Detail

Refinement

public Refinement()

Refinement

public Refinement(java.lang.String name,
                  LList pattern)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface Named

setName

public void setName(java.lang.String name)

getPattern

public LList getPattern()

setPattern

public void setPattern(LList pattern)

getVariableDeclarations

public ix.icore.domain.ListOfVariableDeclaration getVariableDeclarations()

setVariableDeclarations

public void setVariableDeclarations(ix.icore.domain.ListOfVariableDeclaration variableDeclarations)

getNodes

public ix.icore.domain.ListOfNodeSpec getNodes()

setNodes

public void setNodes(ix.icore.domain.ListOfNodeSpec nodes)

getOrderings

public ix.icore.domain.ListOfOrdering getOrderings()

setOrderings

public void setOrderings(ix.icore.domain.ListOfOrdering orderings)

getConstraints

public ix.icore.domain.ListOfConstraint getConstraints()

setConstraints

public void setConstraints(ix.icore.domain.ListOfConstraint cs)

getIssues

public ix.icore.ListOfIssue getIssues()

setIssues

public void setIssues(ix.icore.ListOfIssue issues)

getComments

public java.lang.String getComments()
Overrides:
getComments in class AbstractAnnotatedObject

setVariableDeclarations

public void setVariableDeclarations(java.util.List dcls)

setNodes

public void setNodes(java.util.List nodes)

setOrderings

public void setOrderings(java.util.List orderings)

setConstraints

public void setConstraints(java.util.List constraints)

setIssues

public void setIssues(java.util.List issues)

getFilterConstraints

public ix.icore.domain.ListOfConstraint getFilterConstraints()

getConditions

public ix.icore.domain.ListOfPatternAssignment getConditions()

getEffects

public ix.icore.domain.ListOfPatternAssignment getEffects()

getConstraints

public ix.icore.domain.ListOfConstraint getConstraints(Symbol type,
                                                       Symbol relation)

getConditionConstraints

public ix.icore.domain.ListOfConstraint getConditionConstraints()

getEffectConstraints

public ix.icore.domain.ListOfConstraint getEffectConstraints()

getOtherConstraints

public ix.icore.domain.ListOfConstraint getOtherConstraints()

checkConsistency

public void checkConsistency()
Checks the consistency of this refinement.

Throws:
SyntaxException - if it finds an inconsistency

checkVariableRefs

protected void checkVariableRefs()
Checks that the set of variables declared in this refinement and the set of variables referred to (used) in this refinement are the same.

Throws:
SyntaxException - if the sets are different.

getVariablesUsed

public java.util.SortedSet getVariablesUsed()
Returns a set containing the ItemVars used within this refinement.


getDeclaredVariables

public java.util.SortedSet getDeclaredVariables()
Returns a set containing the ItemVars declared with this refinement.


isDeclared

protected boolean isDeclared(ItemVar v)
Returns true iff this specified variable is declared in this refinement.


checkNodeRefs

protected void checkNodeRefs()
Checks that every node mentioned in a constraint is defined in this refinement.

Throws:
SyntaxException - if there is a reference to an undefined node.

checkInputsAndOutputs

protected void checkInputsAndOutputs()

checkParametersAgainstConstraints

protected void checkParametersAgainstConstraints(Symbol key,
                                                 java.util.List constraints)

instantiate

public Refinement instantiate(MatchEnv env)
Returns a copy of this refinement in which each ItemVar that has a value in the MatchEnv has been replaced by that value.

Throws:
MissingValuesException - if it encounters any variable that is not given a value.

instantiate

public Refinement instantiate(MatchEnv env,
                              Function1 ifUnbound)
Returns a copy of this refinement in which each ItemVar that has a value in the MatchEnv has been replaced by that value. The ifUnbound function is called on any variable that does not have a value in the environment.


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

toString

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