org.processmining.exporting.petrinet.cpnexport.HLImplementation
Class HLDataDependency

java.lang.Object
  extended by org.processmining.exporting.petrinet.cpnexport.HLImplementation.HLDataDependency
All Implemented Interfaces:
java.lang.Cloneable, HighLevelDataDependency

public class HLDataDependency
extends java.lang.Object
implements java.lang.Cloneable, HighLevelDataDependency

Represents a data dependency, which is a constraint on chosing the corresponding alternative path at a decision point in the process.
Note that, currently, the actual constraint is represented as a String that can be directly used in the guard condition of the target transtion of the data dependency. This means that, for the time being, it is assumed that the CPN structure of the DATA colourset is known as well as the names of the attributes that are involved in the constraint.

Author:
arozinat, rmans

Constructor Summary
HLDataDependency(ModelGraphVertex source, ModelGraphVertex target, java.lang.String expr)
          Creates a data dependency for chosing the alternative branch from the given source to the given target node.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
          Equals based on the source node and the target node.
 java.lang.String getEscapedExpression()
          Replaces every "\n" by a "\\n" (needed for DOT visualiztion).
 java.lang.String getExpression()
          Retrieves the expression representing the constraint specified for chosing the represented alternative path.
 javax.swing.JPanel getPanel()
          Returns the GUI panel representing this data dependency.
 ModelGraphVertex getSourceNode()
          Retrieves the source node of the data dependency, i.e., the choice node representing the decision point.
 ModelGraphVertex getTargetNode()
          Retrieves the target node of the data dependency, i.e., the first task or router node on the corresponding alternative path.
 int hashCode()
          Hashcode based on the source node and the target node.
 void setExpression(java.lang.String expression)
          Sets the expression representing the constraint for chosing the alternative path for this dependency (between two nodes)
 void setSourceNode(ModelGraphVertex source)
          Assigns the starting point of the data dependency, i.e., the choice node representing the decision point.
 void setTargetNode(ModelGraphVertex target)
          Assigns the end point of the data dependency, i.e., the first task or router node on the corresponding alternative path.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HLDataDependency

public HLDataDependency(ModelGraphVertex source,
                        ModelGraphVertex target,
                        java.lang.String expr)
Creates a data dependency for chosing the alternative branch from the given source to the given target node.

Parameters:
source -
target -
expression -
Method Detail

getExpression

public java.lang.String getExpression()
Description copied from interface: HighLevelDataDependency
Retrieves the expression representing the constraint specified for chosing the represented alternative path.

Specified by:
getExpression in interface HighLevelDataDependency
Returns:
the dependency expression

getEscapedExpression

public java.lang.String getEscapedExpression()
Replaces every "\n" by a "\\n" (needed for DOT visualiztion).

Returns:
the backslash-escaped data expression

setExpression

public void setExpression(java.lang.String expression)
Description copied from interface: HighLevelDataDependency
Sets the expression representing the constraint for chosing the alternative path for this dependency (between two nodes)

Specified by:
setExpression in interface HighLevelDataDependency
Parameters:
expression - String the expression for this dependency

getSourceNode

public ModelGraphVertex getSourceNode()
Description copied from interface: HighLevelDataDependency
Retrieves the source node of the data dependency, i.e., the choice node representing the decision point.

Specified by:
getSourceNode in interface HighLevelDataDependency
Returns:
the source node of this data dependency

getTargetNode

public ModelGraphVertex getTargetNode()
Description copied from interface: HighLevelDataDependency
Retrieves the target node of the data dependency, i.e., the first task or router node on the corresponding alternative path.

Specified by:
getTargetNode in interface HighLevelDataDependency
Returns:
the target node of this data depencency

setSourceNode

public void setSourceNode(ModelGraphVertex source)
Description copied from interface: HighLevelDataDependency
Assigns the starting point of the data dependency, i.e., the choice node representing the decision point.

Specified by:
setSourceNode in interface HighLevelDataDependency
Parameters:
source - the source node to be set

setTargetNode

public void setTargetNode(ModelGraphVertex target)
Description copied from interface: HighLevelDataDependency
Assigns the end point of the data dependency, i.e., the first task or router node on the corresponding alternative path.

Specified by:
setTargetNode in interface HighLevelDataDependency
Parameters:
target - the target node to be set

equals

public boolean equals(java.lang.Object obj)
Equals based on the source node and the target node. The expression itself is not part of the comparison as it might be subject to change.

Specified by:
equals in interface HighLevelDataDependency
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to be compared
Returns:
boolean whether the this object is equal to the given one

hashCode

public int hashCode()
Hashcode based on the source node and the target node. The expression itself is not part of the hashcode as it might be subject to change.

Specified by:
hashCode in interface HighLevelDataDependency
Overrides:
hashCode in class java.lang.Object
Returns:
int the hashcode value for this highLevelDataDependency

getPanel

public javax.swing.JPanel getPanel()
Returns the GUI panel representing this data dependency. This way, the data dependency can be readily displayed and changes to any property are automatically fed back to the internally held values.

Returns:
the GUI panel representing this data dependency

clone

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