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

java.lang.Object
  extended by org.processmining.exporting.petrinet.cpnexport.HLImplementation.HLAttribute
All Implemented Interfaces:
java.lang.Cloneable, HighLevelDataAttribute, GuiDisplayable

public class HLAttribute
extends java.lang.Object
implements java.lang.Cloneable, HighLevelDataAttribute, GuiDisplayable

A data attribute represents a case data attribute that is available to activities in the process (i.e., they can read it and provide new values).
Each data attribute has

Author:
arozinat, rmans
See Also:
HighLevelProcess#addDataAttribute(HLAttribute), HighLevelActivity#addDataAttribute(HLAttribute)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.processmining.framework.models.hlprocess.HighLevelDataAttribute
HighLevelDataAttribute.AttributeType
 
Constructor Summary
HLAttribute()
          Default constructor.
HLAttribute(HighLevelDataAttribute.AttributeType type, java.lang.String name)
          Constructor to create a data attribute of the specified name and type.
HLAttribute(java.lang.String name)
          Constructor to create a data attribute of the specified type.
HLAttribute(java.lang.String name, java.util.ArrayList<java.lang.String> values)
          Constructor to create a fully-specified nominal data attribute.
HLAttribute(java.lang.String name, Distribution dist, int initVal)
          Constructor to create a fully-specified numeric data attribute.
 
Method Summary
 java.lang.Object clone()
          Make a shallow copy of this object,
 java.lang.String getInitialValueNominal()
          Retrieves the initial value for the associated data attribute.
 int getInitialValueNumeric()
          Retrieves the initial value for the associated data attribute.
 java.lang.String getName()
          Retrieves the name of this data attribute
 javax.swing.JPanel getPanel()
          Returns the GUI panel representing this data attribute.
 java.util.List<java.lang.String> getPossibleValuesNominal()
          Retrieves the possible values for the associated data attribute in the case that it is of a nominal type.
 Distribution getPossibleValuesNumeric()
          Retrieves the possible values for the associated data attribute in the case that it is of a numeric type.
 HighLevelDataAttribute.AttributeType getType()
          Retrieves the attribute type for this data attribute.
 java.lang.String toString()
           
 void writeDistributionToDot(java.lang.String boxId, java.lang.String nodeId, java.lang.String addText, java.io.Writer bw)
          Writes the highlevel data attribute to dot.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.processmining.framework.models.hlprocess.HighLevelDataAttribute
equals, hashCode
 

Constructor Detail

HLAttribute

public HLAttribute()
Default constructor.


HLAttribute

public HLAttribute(java.lang.String name)
Constructor to create a data attribute of the specified type.


HLAttribute

public HLAttribute(HighLevelDataAttribute.AttributeType type,
                   java.lang.String name)
Constructor to create a data attribute of the specified name and type.


HLAttribute

public HLAttribute(java.lang.String name,
                   Distribution dist,
                   int initVal)
Constructor to create a fully-specified numeric data attribute.

Parameters:
name - the name of the data attribute
dist - the distribution of the possible values
initVal - the initial value

HLAttribute

public HLAttribute(java.lang.String name,
                   java.util.ArrayList<java.lang.String> values)
Constructor to create a fully-specified nominal data attribute.

Parameters:
name - the name of the data attribute
values - the possible values (first value in list represents the initial value)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: HighLevelDataAttribute
Retrieves the name of this data attribute

Specified by:
getName in interface HighLevelDataAttribute
Returns:
String the name of this data attribute

getType

public HighLevelDataAttribute.AttributeType getType()
Description copied from interface: HighLevelDataAttribute
Retrieves the attribute type for this data attribute.

Specified by:
getType in interface HighLevelDataAttribute
Returns:
the type of this data attribute

getInitialValueNominal

public java.lang.String getInitialValueNominal()
Description copied from interface: HighLevelDataAttribute
Retrieves the initial value for the associated data attribute.
Note that this value only corresponds to the actual initial value if the attribute type is currently "nominal".

Specified by:
getInitialValueNominal in interface HighLevelDataAttribute
Returns:
the nominal default value

getInitialValueNumeric

public int getInitialValueNumeric()
Description copied from interface: HighLevelDataAttribute
Retrieves the initial value for the associated data attribute.
Note that this value only corresponds to the actual initial value if the attribute type is currently "numeric".

Specified by:
getInitialValueNumeric in interface HighLevelDataAttribute
Returns:
the numeric default value

getPossibleValuesNominal

public java.util.List<java.lang.String> getPossibleValuesNominal()
Description copied from interface: HighLevelDataAttribute
Retrieves the possible values for the associated data attribute in the case that it is of a nominal type.
Note that these values only corresponds to the actual values if the attribute type is currently "nominal".

Specified by:
getPossibleValuesNominal in interface HighLevelDataAttribute
Returns:
the nominal possible values for this data attribute. If no possible values are defined an empty list is returned.

getPossibleValuesNumeric

public Distribution getPossibleValuesNumeric()
Description copied from interface: HighLevelDataAttribute
Retrieves the possible values for the associated data attribute in the case that it is of a numeric type.
Note that these values only corresponds to the actual values if the attribute type is currently "numeric".

Specified by:
getPossibleValuesNumeric in interface HighLevelDataAttribute
Returns:
the numeric possible values for this data attribute. If no possible values are defined an empty list is returned.

getPanel

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

Specified by:
getPanel in interface GuiDisplayable
Returns:
the GUI panel representing this object

clone

public java.lang.Object clone()
Make a shallow copy of this object,

Overrides:
clone in class java.lang.Object
Returns:
Object the cloned object

toString

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

writeDistributionToDot

public void writeDistributionToDot(java.lang.String boxId,
                                   java.lang.String nodeId,
                                   java.lang.String addText,
                                   java.io.Writer bw)
                            throws java.io.IOException
Description copied from interface: HighLevelDataAttribute
Writes the highlevel data attribute to dot. The general idea is that the relevant information of the highlevel data attribute is written in a box and if needed can be connected to another node in the dot file. In that case the connection has to be an undirected line.

Specified by:
writeDistributionToDot in interface HighLevelDataAttribute
Parameters:
boxId - the identifier of the box (in the DOT file) in which the relevant information of the highlevel data attribute will be written.
nodeId - the identifier of the node (in the DOT file) to which the box that will be created has to be connected. "" has to be provided if the box that will be created does not need to be connected to another node in the DOT file.
addText - additional text that needs to be filled in at the beginning of the box
bw - Writer the BufferedWriter used to stream the data to the file
Throws:
java.io.IOException