summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ast-to-instr/src/Waveforms.java')
-rw-r--r--ast-to-instr/src/Waveforms.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/ast-to-instr/src/Waveforms.java b/ast-to-instr/src/Waveforms.java
new file mode 100644
index 0000000..753bae3
--- /dev/null
+++ b/ast-to-instr/src/Waveforms.java
@@ -0,0 +1,30 @@
+import java.util.Map;
+import java.util.HashMap;
+
+public class Waveforms
+{
+ private static final Map<IDs, IDs> TO_WAVEFORM;
+
+ static
+ {
+ TO_WAVEFORM = new HashMap<IDs, IDs>();
+ }
+
+ private Waveforms () {} /* Utility class. */
+
+ public static IDs get_associated_waveform_id (final IDs source)
+ {
+ IDs result;
+
+ result = TO_WAVEFORM.get(source);
+
+ if (result == null)
+ {
+ result = IDs.generate_new_id("waveform");
+
+ TO_WAVEFORM.put(source, result);
+ }
+
+ return result;
+ }
+}