1 /* $Id: Processor.java 1 2010-02-24 13:03:05Z haidw $ */
2 package dol.datamodel.architecture;
4 import java.util.Vector;
6 import dol.datamodel.pn.Process;
7 import dol.visitor.ArchiVisitor;
10 * This class represents a processor element in the architecture.
12 public class Processor extends ArchiResource {
15 * Constructor to create a Processor with a name and an empty
18 public Processor(String name) {
20 _processList = new Vector<Process>();
25 * @param x A Visitor Object.
27 public void accept(ArchiVisitor x) {
28 x.visitComponent(this);
32 * Clone this Processor
34 * @return a new instance of the Processor.
36 @SuppressWarnings("unchecked")
37 public Object clone() {
38 Processor newObj = (Processor) super.clone();
39 newObj.setProcessList((Vector<Process>)_processList.clone());
44 * Get the range of this processor.
48 public String getRange() {
53 * Set the range of this process.
55 * @param range new range value
57 public void setRange(String range) {
62 * Get the type of this processor.
66 public String getType() {
71 * Set the type of this processor.
73 * @param type new range value
75 public void setType(String type) {
82 * Set the list of processes bound to this processor.
83 * @param processList the new process list
85 public void setProcessList(Vector<Process> processList)
87 _processList = processList;
91 * Get the list of processes bound to this processor.
93 public Vector<Process> getProcessList()
99 * Indicates if a process with a specific name is bound
101 * @param name the name of the process to search for
102 * @return true if a process with the specifed name is bound to this
105 public boolean hasProcess(String name)
107 for (Process iter : _processList) {
108 if (iter.getName().equals(name))
116 * Return a description of the processor.
118 * @return a description of the processor.
120 public String toString() {
121 return "Processor: " + getName() ;
125 * Range of the iterator when the instance belongs to an iterated
126 * series of processors.
128 protected String _range;
129 protected String _type;
132 * List of processes bound to this processor.
134 protected Vector<Process> _processList;