public static final int MAX = 0xffffffff;
private static final int FIRST_FREE_EFFECT_ID = 16;
- private static ArrayList<TCon> effectCons = new ArrayList<TCon>();
- private static TObjectIntHashMap<TCon> effectCodes = new TObjectIntHashMap<TCon>();
+ private static ArrayList<TCon> EFFECT_CONS = new ArrayList<TCon>();
+ private static TObjectIntHashMap<TCon> EFFECT_CODES = new TObjectIntHashMap<TCon>();
- private static void add(String module, String name, int code) {
- TCon con = Types.con(module, name);
- effectCodes.put(con, code);
- effectCons.add(con);
+ private static void add(TCon con, int code) {
+ EFFECT_CODES.put(con, code);
+ EFFECT_CONS.add(con);
}
static {
- add("Simantics/DB", "WriteGraph", 12);
- add("Simantics/DB", "ReadGraph", 4);
- add(Types.BUILTIN, "Proc", 1);
+ add(Types.WRITE_GRAPH, 0b11);
+ add(Types.READ_GRAPH, 0b01);
}
private ArrayList<Type> localCons = new ArrayList<Type>();
id |= toId(e, metaVars);
return id;
}
- else if(effectCodes.contains(type)) {
- return effectCodes.get(type);
+ else if(EFFECT_CODES.contains(type)) {
+ return EFFECT_CODES.get(type);
}
else if(type instanceof TMetaVar) {
metaVars.add((TMetaVar)type);
if(id == 0)
return Types.NO_EFFECTS;
ArrayList<Type> components = new ArrayList<Type>();
- for(TCon con : effectCons) {
- int conId = effectCodes.get(con);
+ for(TCon con : EFFECT_CONS) {
+ int conId = EFFECT_CODES.get(con);
if((id&conId) == conId) {
components.add(con);
id ^= conId;