Blame view

BRIC/src/CREATOR_CONDICTIONS_RULES/CreatorNamesOfProcessCSP.java 3.93 KB
eeb5cac08   Madiel de Souza Conserva Filho   first
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
  /*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package CREATOR_CONDICTIONS_RULES;
  
  import LOGIC.Instance;
  import LOGIC.Protocols;
  import java.util.LinkedList;
  
  /**
   *
   * @author sarah
   */
  public class CreatorNamesOfProcessCSP {
  
      private LinkedList<Protocols> prot;
      private LinkedList<Instance> instance;
      private LinkedList<String> guardanomeProcessoProt_Imp; // vai guardar o seguinte: PROT_IMP_ResultComposition_<canal>
      private LinkedList<String> guardanomeProcessoDual_Prot_Imp; // vai guardar o seguinte: PROT_IMP_ResultComposition_<canal>
      private LinkedList<String> prot_RIO;
      private LinkedList<String> dual_prot_RIO;
      private LinkedList<String> peganome;
      
      public CreatorNamesOfProcessCSP(LinkedList<Instance> i, LinkedList<Protocols> p) {
          this.prot = p;
          this.instance = i;
          guardanomeProcessoProt_Imp = new LinkedList<>();
          guardanomeProcessoDual_Prot_Imp = new LinkedList<>();
          prot_RIO = new LinkedList<>();
          dual_prot_RIO = new LinkedList<>();
          peganome = new LinkedList<>();
          
          //peganome.add(instance.get(0).getName().replace(".","_"));
          //peganome.add(instance.get(1).getName().replace(".","_"));
          peganome.add(prot.get(0).getCanal().getName().replace(".","_"));
          peganome.add(prot.get(1).getCanal().getName().replace(".","_"));
      }
  
      public LinkedList<String> CreatorProt_Name() {
  
          
          // guardar nomo do processo no array p/ posteriormente ser usado na função apply.
          // EX.: PROT_IMP_<contract>_<canal>
          guardanomeProcessoProt_Imp.add("PROT_IMP_" + 
                  instance.get(0).getName() + "_" + 
                  peganome.get(0));
  
          guardanomeProcessoProt_Imp.add("PROT_IMP_" + 
                  instance.get(1).getName() + "_" + 
                  peganome.get(1));
  
          return guardanomeProcessoProt_Imp;
      }
  
      public LinkedList<String> CreatorDual_Prot_Name() {
  
          // guardar nomo do processo no array p/ posteriormente ser usado na função apply.
          // EX.: DUAL_PROT_IMP_<contract>_<canal>
          guardanomeProcessoDual_Prot_Imp.add("DUAL_PROT_IMP_" + 
                  instance.get(0).getName() + "_" + 
                  peganome.get(0));
  
          guardanomeProcessoDual_Prot_Imp.add("DUAL_PROT_IMP_" + 
                  instance.get(1).getName() + "_" + 
                  peganome.get(1));
          
          return guardanomeProcessoDual_Prot_Imp;
      }
      
      public LinkedList<String> CreatorProt_RIO(){
      
          // PROT_IMP_<contract>_<channel1>_R_I_O_<channel2>
          prot_RIO.add("PROT_IMP_" + instance.get(0).getName() + "_" + 
                  peganome.get(0) + "_R_IO_" + 
                  peganome.get(1));
          
          prot_RIO.add("PROT_IMP_" + instance.get(1).getName() + "_" + 
                  peganome.get(1) + "_R_IO_" + 
                  peganome.get(0));
          
          return prot_RIO;
      }
      
      public LinkedList<String> CreatorDual_Prot_RIO(){
      
          // DUAL_PROT_IMP_<contract>_<channel1>_R_I_O_<channel2>
          dual_prot_RIO.add("DUAL_PROT_IMP_" + instance.get(0).getName() + 
                  "_" + peganome.get(0)
                  + "_R_IO_" + peganome.get(1));
          
          dual_prot_RIO.add("DUAL_PROT_IMP_" + instance.get(1).getName() + 
                  "_" + peganome.get(1)
                  + "_R_IO_" + peganome.get(0));
                  
          return dual_prot_RIO;
      }
      
       public LinkedList<String> CreatorProt_Name_Unary() {
  
          
          // guardar nomo do processo no array p/ posteriormente ser usado na função apply.
          // EX.: PROT_IMP_<contract>_<canal>
          guardanomeProcessoProt_Imp.add("PROT_IMP_" + 
                  instance.get(0).getName() + "_" + 
                  peganome.get(0));
  
          guardanomeProcessoProt_Imp.add("PROT_IMP_" + 
                  instance.get(0).getName() + "_" + 
                  peganome.get(1));
  
          return guardanomeProcessoProt_Imp;
      }
  }