X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fdatamodel%2Fpn%2FSourceCode.java;fp=dol%2Fsrc%2Fdol%2Fdatamodel%2Fpn%2FSourceCode.java;h=26f09e1464dfaa0dc068aeb86025f2e5e20d6a25;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/datamodel/pn/SourceCode.java b/dol/src/dol/datamodel/pn/SourceCode.java new file mode 100644 index 0000000..26f09e1 --- /dev/null +++ b/dol/src/dol/datamodel/pn/SourceCode.java @@ -0,0 +1,131 @@ +/* $Id: SourceCode.java 1 2010-02-24 13:03:05Z haidw $ */ +package dol.datamodel.pn; + +import dol.visitor.PNVisitor; + +/** + * This class is the basic source code of a process. + */ +public class SourceCode { + + /** + * Constructor to create a SourceCode with a name. + */ + public SourceCode(String name) { + _name = name; + } + + /** + * Accept a visitor. + * + * @param x visitor object + */ + public void accept(PNVisitor x) { + x.visitComponent(this); + } + + /** + * Clone this SourceCode. + * + * @return new instance of the SourceCode. + */ + public Object clone() { + try { + SourceCode newObj = (SourceCode) super.clone(); + newObj.setName(_name); + newObj.setType(_type); + newObj.setLocality(_locality); + newObj.setProcess( (Process) _process.clone() ); + return (newObj); + } catch (CloneNotSupportedException e) { + System.out.println("Error Clone not Supported"); + } + return null; + } + + /** + * Get the name of this SourceCode. + * + * @return the name + */ + public String getName() { + return _name; + } + + /** + * Set the name of this SourceCode. + * + * @param name name of the SourceCode + */ + public void setName(String name) { + _name = name; + } + + /** + * Get the process of this SourceCode. + * + * @return process to which this SourceCode belongs + */ + public Process getProcess() { + return _process; + } + + /** + * Set the proces of this SourceCode. + * + * @param process process to which this SourceCode belongs + */ + public void setProcess(Process process) { + _process = process; + } + + /** + * Get the locality of this SourceCode. + * + * @return locality of the SourceCode + */ + public String getLocality() { + return _locality; + } + + /** + * Set the locality of this SourceCode. + * + * @param locality locality of the SourceCode + */ + public void setLocality(String locality) { + _locality = locality; + } + + /** + * Get the type of this SourceCode. + * + * @return type of the SourceCode + */ + public String getType() { + return _type; + } + + /** + * Set the type of this SourceCode. + * + * @param type The new type + */ + public void setType(String type) { + _type = type; + } + + /** + * Return a string representation of the SourceCode. + * + * @return string representation of the SourceCode + */ + public String toString() { + return "SourceCode: " + _name; + } + + protected String _name = null; + protected Process _process = null; + protected String _type = null; + protected String _locality = null; +}