org.processmining.exporting.petrinet.cpnexport
Class CpnColorSet

java.lang.Object
  extended by org.processmining.exporting.petrinet.cpnexport.CpnColorSet
Direct Known Subclasses:
EnumeratedColorSet, IntegerColorSet, ProductColorSet, RecordColorSet, StringColorSet, SubSetColorSet

public abstract class CpnColorSet
extends java.lang.Object

An abstract class that defines the structure for each colorset that is available in CPN tools. In the case that a new color set has to be defined, only the write method needs to be implemented, because all the other properties hold for each colorset in CPN tools. If needed any inheriting class may be defined its own additional properties and methods

Author:
rmans, arozinat

Field Summary
protected  java.lang.String myNameColorSet
          the name of the colorset
 
Constructor Summary
CpnColorSet()
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares this object with an other CpnColorSet object for equality.
 java.lang.String getNameColorSet()
          Retrieves the name of the colorset
 int hashCode()
          Calculates the hashcode.
 void setNameColorSet(java.lang.String name)
          Sets the name of the colorset.
abstract  void write(java.io.BufferedWriter bw, ManagerID idMan)
          This method needs to be implemented, so that each colorset can write itself to the cpn-file (for the declarations part).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myNameColorSet

protected java.lang.String myNameColorSet
the name of the colorset

Constructor Detail

CpnColorSet

public CpnColorSet()
Method Detail

getNameColorSet

public java.lang.String getNameColorSet()
Retrieves the name of the colorset

Returns:
String the name of the colorset

setNameColorSet

public void setNameColorSet(java.lang.String name)
Sets the name of the colorset.

Parameters:
name - String the name of the colorset.

equals

public boolean equals(java.lang.Object o)
Compares this object with an other CpnColorSet object for equality.

Overrides:
equals in class java.lang.Object
Parameters:
o - Object the object that needs to be compared with this object.
Returns:
boolean true, if both objects are of the same type and have the same name.

hashCode

public int hashCode()
Calculates the hashcode.

Overrides:
hashCode in class java.lang.Object
Returns:
int the hashcode.

write

public abstract void write(java.io.BufferedWriter bw,
                           ManagerID idMan)
                    throws java.io.IOException
This method needs to be implemented, so that each colorset can write itself to the cpn-file (for the declarations part).

Parameters:
bw - BufferedWriter the BufferedWriter used to stream the data to the file.
idMan - ManagerID the idManager that generates new cpn IDs. (@see ManagerID.java)
Throws:
java.io.IOException