Coadj2SimpleSynchTransEnv.java 2.01 KB
  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
package jcircus.complementaryenvs;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Vector;

import jcircus.parallelism.HiddenFromGUIInfo;
import jcircus.translator.Translator2Java;
/*
String chanName,
HiddenFromGUIInfo hid,
ChanTransMSEnv ctmse,
ChanComplexCommEnv ccce,
ChanDotFieldEnv cdfe,
ChanExtChoiceEnv cece,
ChanDimEnv cde

* */
public class Coadj2SimpleSynchTransEnv {
//Classe para auxiliar na utilização do método hiddenSync
private HashMap <String, Boolean> mapCoadjs;
private Vector <String> coadjs;
private HiddenFromGUIInfo hid;
private ChanTransMSEnv ctmse;
private ChanComplexCommEnv ccce;
private ChanDotFieldEnv cdfe;
private ChanExtChoiceEnv cece;
private ChanDimEnv cde;
private boolean cmain;

public Coadj2SimpleSynchTransEnv (
String mainChannel,
HiddenFromGUIInfo hid,
ChanTransMSEnv ctmse,
ChanComplexCommEnv ccce,
ChanDotFieldEnv cdfe,
ChanExtChoiceEnv cece,
ChanDimEnv cde,
boolean cmain
) {
this.mapCoadjs = new LinkedHashMap <String, Boolean> ();
this.coadjs = hid.reverseGetWithoutMainChannel(mainChannel);
this.hid = hid;
this.ctmse = ctmse;
this.ccce = ccce;
this.cdfe = cdfe;
this.cece = cece;
this.cde = cde;
this.updateCoadjs ();
this.cmain = cmain;
}
private void updateCoadjs () {
int size = this.coadjs.size();
for (int i = 0; i < size; i++) {
if (Translator2Java.isTranslatedAsSimpleSynchronised
(coadjs.get(i),
//hid,
ctmse,
ccce,
cdfe,
cece,
cde,
cmain
)
)
{
this.update(coadjs.get(i), true);
}
else {
this.update(coadjs.get(i), false);
}
}
}
private void update (String channelName, boolean b) {
if (mapCoadjs.containsKey (channelName)) {
mapCoadjs.remove (channelName);
}
this.mapCoadjs.put (channelName, b);
}
public boolean get (String channelName) {
if (!this.mapCoadjs.containsKey(channelName)) {
return false;
}
return this.mapCoadjs.get (channelName);
}
}