1 /* $Id: Memory.java 1 2010-02-24 13:03:05Z haidw $ */
2 package dol.datamodel.architecture;
4 import java.util.Iterator;
5 import java.util.Vector;
7 import dol.visitor.ArchiVisitor;
10 * This class represents a memory element in the archietcture.
12 public class Memory extends ArchiResource {
14 * Constructor to create a Memory with a name and an empty
17 public Memory(String name) {
19 _rxBufList = new Vector<String>();
20 _txBufList = new Vector<String>();
21 _chBufList = new Vector<String>();
26 * @param x A Visitor Object.
28 public void accept(ArchiVisitor x) {
29 x.visitComponent(this);
35 * @return a new instance of the Memory.
37 @SuppressWarnings("unchecked")
38 public Object clone() {
39 Memory newObj = (Memory) super.clone();
40 newObj.setRXBufList((Vector<String>)_rxBufList.clone());
41 newObj.setTXBufList((Vector<String>)_txBufList.clone());
42 newObj.setCHBufList((Vector<String>)_chBufList.clone());
47 * Get the range of this Memory.
51 public String getRange() {
56 * Set the range of this Memory.
58 * @param range new range value
60 public void setRange(String range) {
65 * Get the type of this Memory.
69 public String getType() {
74 * Set the type of this Memory.
76 * @param type new range value
78 public void setType(String type) {
83 * Get the list of RXBuf of this memory
85 * @return list of RX buffer.
87 public Vector<String> getRXBufList() {
92 * Set the list of RXBuf of this memory.
94 * @param list RX buffer list
96 public void setRXBufList(Vector<String> list) {
101 * Get the list of TXBuf of this memory.
103 * @return list of TX buffers.
105 public Vector<String> getTXBufList() {
110 * Set the list of TXBuf of this memory.
112 * @param list TX buffer list
114 public void setTXBufList(Vector<String> list) {
119 * Get the list of channel buffers of this memory.
121 * @return list of channel buffers.
123 public Vector<String> getCHBufList() {
128 * Set the list of channel Buf of this memory.
130 * @param list channel buffer list
132 public void setCHBufList(Vector<String> list) {
137 * Has this memory nodes?
139 * @return boolean value
141 public boolean hasNodes() {
142 Iterator<Node> i = getNodeList().iterator();
143 while (i.hasNext()) {
151 * Return a description of the Memory.
153 * @return a description of the Memory.
155 public String toString() {
156 return "Memory: " + getName() ;
160 * Range of the iterator when the instance belongs to an iterated
161 * series of Memories.
163 protected String _range;
164 protected String _type;
166 // store the name of rx, tx channel buffer, can be used for dotty gen.
167 protected Vector<String> _rxBufList;
168 protected Vector<String> _txBufList;
169 protected Vector<String> _chBufList;