Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
7d241345d386f7fd6fa9d7db1a76e02c8d55d6bc
[mapping.git] / src / and / Mapping / Association.java
1 package and.Mapping ;
2
3
4 import java.io.Serializable;
5 import java.util.ArrayList;
6
7
8
9 /**
10  * Class representing an association between a tasks list and a cluster
11  * on which they are mapped, or between a task and a computing node
12  * @author Sébastien Miquée
13  *
14  */
15 public class Association implements Serializable
16 {
17         private static final long serialVersionUID = 1L;
18
19         
20         private Cluster c = null ;
21         private ArrayList<GTask> at = null ;
22         private GNode g = null ;
23         private GTask t = null ;
24         
25         /**
26          * Default constructor.
27          */
28         public Association(){}
29         
30         
31         /**
32          * Constructor.
33          * @param _c Associated cluster
34          * @param _at Tasks list
35          */
36         public Association( Cluster _c, ArrayList<GTask> _at )
37         {
38                 c = _c ;
39                 at = _at ;
40         }
41         
42         
43         /**
44          * Constructor.
45          * @param _g Associated computing node
46          * @param _t Associated task
47          */
48         public Association( GNode _g, GTask _t )
49         {
50                 g = _g ;
51                 t = _t ;
52         }
53         
54         
55         /**
56          * Return the associated cluster.
57          * @return The associated cluster
58          */
59         public Cluster getCluster()
60         {       
61                 return c ;
62         }
63         
64         
65         /**
66          * Return the associated tasks list.
67          * @return The associated tasks list
68          */
69         public ArrayList<GTask> getGtask()
70         {
71                 return at ;
72         }
73         
74         /**
75          * Return the associated computing node.
76          * @return The associated node
77          */
78         public GNode getGNode()
79         {
80                 return g ;
81         }
82         
83         
84         /**
85          * Return the associated task.
86          * @return The associated task
87          */
88         public GTask getGTask()
89         {
90                 return t ;
91         }
92         
93         
94         /**
95          * Replace the GNode of the association.
96          * @param _g The replacing GNode
97          */
98         public void setGNode( GNode _g )
99         {
100                 g = _g ;
101         }
102         
103         
104         /**
105          * Replace the GTask of the association.
106          * @param _t The replacing GTask
107          */
108         public void setGtask( GTask _t )
109         {
110                 t = _t ;
111         }
112         
113 }
114
115 /** La programmation est un art, respectons ceux qui la pratiquent !! **/