org.processmining.exporting.petrinet.cpnexport.HLImplementation.HLDistribution
Class HLConstantDistribution

java.lang.Object
  extended by org.processmining.framework.models.hlprocess.Distribution
      extended by org.processmining.exporting.petrinet.cpnexport.HLImplementation.HLDistribution.HLConstantDistribution
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class HLConstantDistribution
extends Distribution
implements java.lang.Cloneable

Represents a constant distribution that can be readily displayed as it maintains its own GUI panel. The distribution will be graphically represented by one spinner representing the constant value.
Changes performed via the GUI will be immedeately propagated to the internally held property values.

Author:
arozinat, rmans
See Also:
getDistributionPanel, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.processmining.framework.models.hlprocess.Distribution
Distribution.DistributionEnum
 
Constructor Summary
HLConstantDistribution(double constant)
          Creates a constant distribution based on a value for the constant.
HLConstantDistribution(GUIPropertyDoubleTextField constant)
          Creates a constant distribution from an existing GUIPropertyDouble.
 
Method Summary
 boolean checkValuesOfTimeParameters(java.lang.String info)
          Check whether parameters, which can be related to time, in the Distribution will get value '0' when these are rounded.
 java.lang.Object clone()
          Clones the object.
 boolean equals(java.lang.Object obj)
          Determines when two distribution objects are the same.
 double getConstant()
          Returns the constant value of this constant distribution.
 java.lang.String getCpnDistributionFunction()
          Returns the cpn-specific distribution function (cpn syntax).
 javax.swing.JPanel getDistributionPanel()
          Creates GUI panel representing this distribution, ready to display in some settings dialog.
 Distribution.DistributionEnum getDistributionType()
          Indicates the type of this distribution.
 int hashCode()
          Retrieves the hashcode for the object.
 void timeMultiplicationValue(double value)
          Defines the factor with which the values in the distribution that refer to time need to be multiplicated with
 java.lang.String toString()
          The string representation for this constant distribution.
 void writeDistributionToDot(java.lang.String boxId, java.lang.String nodeId, java.lang.String addText, java.io.Writer bw)
          Writes the distribution to dot.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HLConstantDistribution

public HLConstantDistribution(double constant)
Creates a constant distribution based on a value for the constant.

Parameters:
constant - the constant value of the distribution

HLConstantDistribution

public HLConstantDistribution(GUIPropertyDoubleTextField constant)
Creates a constant distribution from an existing GUIPropertyDouble.

Parameters:
constant - the constant value of the distribution
Method Detail

getConstant

public double getConstant()
Returns the constant value of this constant distribution.

Returns:
the constant value

getCpnDistributionFunction

public java.lang.String getCpnDistributionFunction()
Description copied from class: Distribution
Returns the cpn-specific distribution function (cpn syntax).

Specified by:
getCpnDistributionFunction in class Distribution
Returns:
String the cpn-specific distribution function (cpn syntax)

getDistributionType

public Distribution.DistributionEnum getDistributionType()
Description copied from class: Distribution
Indicates the type of this distribution.

Specified by:
getDistributionType in class Distribution
Returns:
the type of this distribution

getDistributionPanel

public javax.swing.JPanel getDistributionPanel()
Description copied from class: Distribution
Creates GUI panel representing this distribution, ready to display in some settings dialog.

Specified by:
getDistributionPanel in class Distribution
Returns:
the graphical panel representing this distribution

clone

public java.lang.Object clone()
Clones the object.

Overrides:
clone in class Distribution
Returns:
the cloned object

toString

public java.lang.String toString()
The string representation for this constant distribution.

Overrides:
toString in class java.lang.Object
Returns:
String the string representation.

equals

public boolean equals(java.lang.Object obj)
Description copied from class: Distribution
Determines when two distribution objects are the same. Two Distributions are the same when they are both of the same object type and that the values for all the parameters of the particular distribution are the same.

Specified by:
equals in class Distribution
Parameters:
obj - Object the object to compare with
Returns:
boolean true when the two distribution objects are the same object and that the values for all the parameters of the particalur distribution are the same. false otherwise

hashCode

public int hashCode()
Description copied from class: Distribution
Retrieves the hashcode for the object. The hashcode value for a Distribution object is calculated according to the recipe of Josha Bloch in Effective Java (Addison-Wesley 2001). For this recipe it is only allowed to consider the fields that correspond with the parameter(s) of the particular distribution.

Specified by:
hashCode in class Distribution
Returns:
int the hashcode value for the Distribution 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 class: Distribution
Writes the distribution to dot. The general idea is that the parameters and other relevant information of the distribution are 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 class Distribution
Parameters:
boxId - the identifier of the box (in the DOT file) in which the parameters and other relevant information of the distribution 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

timeMultiplicationValue

public void timeMultiplicationValue(double value)
Description copied from class: Distribution
Defines the factor with which the values in the distribution that refer to time need to be multiplicated with

Specified by:
timeMultiplicationValue in class Distribution
Parameters:
value - double

checkValuesOfTimeParameters

public boolean checkValuesOfTimeParameters(java.lang.String info)
Description copied from class: Distribution
Check whether parameters, which can be related to time, in the Distribution will get value '0' when these are rounded. When such a parameter gets value '0' after rounding, a warning needs to be issued. Furthermore, when a warning is raised the value 'true' needs to be returned

Specified by:
checkValuesOfTimeParameters in class Distribution
Parameters:
info - Additional information to be displayed when a warning is issued.
Returns:
boolean the value true needs to be returned when a warning has been issued by the method, otherwise false.