diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-10 23:40:25 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-10 23:40:25 -0600 |
commit | 1080b37bbe40fe56b919d22804c159cccdca3c95 (patch) | |
tree | 8ddbb9528f575e537f925b266c8f366be6acc8b7 /boil/library/TypeFactory.java | |
parent | 61a28b7f8e709d1884ccab15f0dc38ed19dfde70 (diff) |
Library rename, created A4 directories
Diffstat (limited to 'boil/library/TypeFactory.java')
-rw-r--r-- | boil/library/TypeFactory.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/boil/library/TypeFactory.java b/boil/library/TypeFactory.java new file mode 100644 index 0000000..8dd910e --- /dev/null +++ b/boil/library/TypeFactory.java @@ -0,0 +1,25 @@ +package boil.library; + +import java.util.HashMap; +import st.TypeInstance; + +public class TypeFactory { + + private int type_num; + private HashMap<TypeInstance,String> map; + + public void reset() { + this.type_num = 0; + this.map = new HashMap<>(); + } + + public String addNewAlias(TypeInstance t) { + String alias = String.format("t.%d", this.type_num++); + this.map.put(t, alias); + return alias; + } + + public String retrieveAlias(TypeInstance t) { + return this.map.get(t); + } +} |