X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fdatamodel%2Farchitecture%2FVariable.java;fp=dol%2Fsrc%2Fdol%2Fdatamodel%2Farchitecture%2FVariable.java;h=2c91a2d76713635d32475068fbdb3d1bd27b6fef;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/datamodel/architecture/Variable.java b/dol/src/dol/datamodel/architecture/Variable.java new file mode 100644 index 0000000..2c91a2d --- /dev/null +++ b/dol/src/dol/datamodel/architecture/Variable.java @@ -0,0 +1,109 @@ +/* $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; +}