X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fdatamodel%2Farchitecture%2FHWChannel.java;fp=dol%2Fsrc%2Fdol%2Fdatamodel%2Farchitecture%2FHWChannel.java;h=f4ed94ed2ec25dff081aec9d03ecfc0bb8dbf62c;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/datamodel/architecture/HWChannel.java b/dol/src/dol/datamodel/architecture/HWChannel.java new file mode 100644 index 0000000..f4ed94e --- /dev/null +++ b/dol/src/dol/datamodel/architecture/HWChannel.java @@ -0,0 +1,128 @@ +/* $Id: HWChannel.java 1 2010-02-24 13:03:05Z haidw $ */ +package dol.datamodel.architecture; + +import java.util.Iterator; +import java.util.Vector; + +import dol.visitor.ArchiVisitor; + +/** + * This class represents an interconnect element in the architecture. + */ +public class HWChannel extends ArchiResource { + /** + * Constructor to create a HWChannel with a name and an empty + * nodeList. + */ + public HWChannel(String name) { + super(name); + _pathList = new Vector(); + } + + /** + * Accept a Visitor + * @param x A Visitor Object. + */ + public void accept(ArchiVisitor x) { + x.visitComponent(this); + } + + /** + * Clone this HWChannel + * + * @return a new instance of the HWChannel. + */ + @SuppressWarnings("unchecked") + public Object clone() { + HWChannel newObj = (HWChannel) super.clone(); + newObj.setPathList((Vector)_pathList.clone()); + return (newObj); + } + + /** + * Get the range of this processor. + * + * @return range + */ + public String getRange() { + return _range; + } + + /** + * Set the range of this process. + * + * @param range new range value + */ + public void setRange(String range) { + _range= range; + } + + /** + * Get the type of this hw_channel. + * + * @return type + */ + public String getType() { + return _type; + } + + /** + * Set the type of this hw_channel. + * + * @param type new range value + */ + public void setType(String type) { + _type= type; + } + + /** + * Has this processor nodes? + * + * @return boolean value + */ + public boolean hasNodes() { + Iterator i = getNodeList().iterator(); + while (i.hasNext()) { + i.next(); + return true; + } + return false; + } + + /** + * Get the list of pathes via this resource. + * + * @return list of path. + */ + public Vector getPathList() { + return _pathList; + } + + /** + * Set the list of pathes via this resource. + * + * @param list path list + */ + public void setPathList(Vector list) { + _pathList = list; + } + + /** + * Return a description of the processor. + * + * @return a description of the processor. + */ + public String toString() { + return "HWChannel: " + getName() ; + } + + /** + * Range of the iterator when the instance belongs to an iterated + * series of processors. + */ + protected String _range; + protected String _type; + + // Store the name of pathes which go via this communication resource. + protected Vector _pathList; +}