--- /dev/null
+/* $Id: Variable.java 1 2010-02-24 13:03:05Z haidw $ */
+package dol.datamodel.architecture;
+
+import dol.visitor.ArchiVisitor;
+
+/**
+ * This class represents a global variable in the architecture XML.
+ */
+public class Variable implements Cloneable {
+
+ /**
+ * Constructor to create a Variable.
+ */
+ public Variable(String name) {
+ _name = name;
+ }
+
+ /**
+ * Accept a Visitor.
+ *
+ * @param x visitor object
+ */
+ public void accept(ArchiVisitor x) {
+ x.visitComponent(this);
+ }
+
+ /**
+ * Clone this Variable.
+ *
+ * @return new instance of the Variable.
+ */
+ public Object clone() {
+ try {
+ Variable newObj = (Variable) super.clone();
+ newObj.setName(_name);
+ return (newObj);
+ } catch (CloneNotSupportedException e) {
+ System.out.println("Error Clone not Supported");
+ }
+ return null;
+ }
+
+ /**
+ * Get the value of the Variable.
+ *
+ * @return the value of the variable
+ */
+ public int getValue() {
+ return _value;
+ }
+
+ /**
+ * Set the value of the Variable.
+ *
+ * @param value the value of the variable
+ */
+ public void setValue(int value) {
+ _value = value;
+ }
+
+ /**
+ * 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 parent ArchiResource.
+ *
+ * @return parent ArchiResource
+ */
+ public ArchiResource getParentResource() {
+ return _parentResource;
+ }
+
+ /**
+ * Set the parent ArchiResource.
+ *
+ * @param parentResource new parent
+ */
+ public void setParentResource(ArchiResource parentResource) {
+ _parentResource = parentResource;
+ }
+
+ /**
+ * Return a string representation of the Variable.
+ *
+ * @return string representation of the Variable
+ */
+ public String toString() {
+ return "Variable: " + getName();
+ }
+
+ protected int _value;
+ protected String _name = null;
+ protected ArchiResource _parentResource = null;
+}