AllDeclsEnv.java 741 Bytes
  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
package jcircus.complementaryenvs;

import java.util.HashMap;

public class AllDeclsEnv {
private HashMap <String, String> map;
public AllDeclsEnv () {
this.map = new HashMap <String, String> ();
}
public String get (String key) {
String subkey;
int keylength = key.length();
if (key.contains("aux_left_")) {
subkey = key.substring(9, keylength - 3);
System.out.print("");
}
else if (key.contains("aux_right_")) {
subkey = key.substring(10, keylength - 3);
System.out.print("");
}
else {
subkey = new String (key);
}
return map.get(subkey);
}
public void put (String key, String value) {
map.put(key, value);
}
public void putAll (HashMap <String, String> varnames) {
map.putAll(varnames);
}
}