dol: initial dol commit
[jump.git] / dol / src / dol / datamodel / mapping / Binding.java
1 package dol.datamodel.mapping;
2
3 import dol.visitor.MapVisitor;
4
5 /**
6  * This class represents a binding element in the mapping.
7  */
8 abstract public class Binding extends MapResource {
9
10     /**
11      * Constructor to create a Binding with a name.
12      */
13     public Binding(String name) {
14         super(name);
15     }
16
17     /**
18      * Accept a Visitor
19      * @param x A Visitor Object.
20      */
21     public void accept(MapVisitor x) {
22         x.visitComponent(this);
23     }
24
25     /**
26      * Clone this Binding
27      *
28      * @return a new instance of the Binding.
29      */
30     public Object clone() {
31         Binding newObj = (Binding) super.clone();
32         return (newObj);
33     }
34
35     /**
36      * Get the range of this binding.
37      *
38      * @return range
39      */
40     public String getRange() {
41         return _range;
42     }
43
44     /**
45      * Set the range of this binding.
46      *
47      * @param range new range value
48      */
49     public void setRange(String range) {
50         _range= range;
51     }
52
53     /**
54      * Get the type of this binding.
55      *
56      * @return type
57      */
58     public String getType() {
59         return _type;
60     }
61
62     /**
63      * Return a description of the binding.
64      *
65      * @return a description of the binding.
66      */
67     public String toString() {
68         return "Binding: " + getName() ;
69     }
70
71     /**
72      * Range of the iterator when the instance belongs to an iterated
73      * series of bindings.
74      */
75     protected String _range;
76     protected String _type;
77
78     /**
79      * Type specifier for communication bindings.
80      */
81     public static final String COMMUNICATION = "communication";
82     
83     /**
84      * Type specifier for computation bindings.
85      */
86     public static final String COMPUTATION = "computation";
87 }