1 package dol.datamodel.mapping;
3 import dol.visitor.MapVisitor;
6 * This class is the basic class which abstracts a mapping resource.
8 public class MapResource implements Cloneable {
10 * Constructor to create a mapping resource with a name.
12 public MapResource(String name) {
20 * @param x visitor object
22 public void accept(MapVisitor x) {
23 x.visitComponent(this);
27 * Clone this mapping resource.
29 * @return new instance of the mapping resource.
31 public Object clone() {
33 MapResource newObj = (MapResource) super.clone();
34 newObj.setName(_name);
35 newObj.setBasename(_basename);
37 } catch (CloneNotSupportedException e) {
38 System.out.println("Error Clone not Supported");
44 * Get the name of this mapping resource.
46 * @return name of the mapping resource
48 public String getName() {
53 * Set the name of this mapping resource.
55 * @param name name of the mapping resource
57 public void setName(String name) {
62 * Get the basename of this mapping resource.
64 * @return basename of the mapping resource
66 public String getBasename() {
71 * Set the basename of this mapping resource.
73 * @param basename name of the mapping resource
75 public void setBasename(String basename) {
80 * Get the hierarchical parent of this mapping resource.
82 * @return parent of this mapping resource
84 public MapResource getParentResource() {
85 return _parentResource;
89 * Set the hierarchical parent of this mapping resource.
91 * @param parentResource new parent
93 public void setParentResource(MapResource parentResource) {
94 _parentResource = parentResource;
98 * Return a string representation of the architectural resource.
100 * @return string representation of the architectural resource
102 public String toString() {
103 return "MapResource: " + _name;
106 /** name of the architectural resource */
107 protected String _name = null;
109 /** basename of the architectural resource, if no basename, store the name */
110 protected String _basename = null;
113 * parent resource of this architectural resource in a hierarchical architecture network
115 protected MapResource _parentResource = null;