1 /* $Id: SourceCode.java 1 2010-02-24 13:03:05Z haidw $ */
2 package dol.datamodel.pn;
4 import dol.visitor.PNVisitor;
7 * This class is the basic source code of a process.
9 public class SourceCode {
12 * Constructor to create a SourceCode with a name.
14 public SourceCode(String name) {
21 * @param x visitor object
23 public void accept(PNVisitor x) {
24 x.visitComponent(this);
28 * Clone this SourceCode.
30 * @return new instance of the SourceCode.
32 public Object clone() {
34 SourceCode newObj = (SourceCode) super.clone();
35 newObj.setName(_name);
36 newObj.setType(_type);
37 newObj.setLocality(_locality);
38 newObj.setProcess( (Process) _process.clone() );
40 } catch (CloneNotSupportedException e) {
41 System.out.println("Error Clone not Supported");
47 * Get the name of this SourceCode.
51 public String getName() {
56 * Set the name of this SourceCode.
58 * @param name name of the SourceCode
60 public void setName(String name) {
65 * Get the process of this SourceCode.
67 * @return process to which this SourceCode belongs
69 public Process getProcess() {
74 * Set the proces of this SourceCode.
76 * @param process process to which this SourceCode belongs
78 public void setProcess(Process process) {
83 * Get the locality of this SourceCode.
85 * @return locality of the SourceCode
87 public String getLocality() {
92 * Set the locality of this SourceCode.
94 * @param locality locality of the SourceCode
96 public void setLocality(String locality) {
101 * Get the type of this SourceCode.
103 * @return type of the SourceCode
105 public String getType() {
110 * Set the type of this SourceCode.
112 * @param type The new type
114 public void setType(String type) {
119 * Return a string representation of the SourceCode.
121 * @return string representation of the SourceCode
123 public String toString() {
124 return "SourceCode: " + _name;
127 protected String _name = null;
128 protected Process _process = null;
129 protected String _type = null;
130 protected String _locality = null;