| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-19 20:24:40 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-19 20:24:40 +0200 |
| commit | 158f8ef180d4ea448b351599529db53ff5e88f8c (patch) | |
| tree | 2982efaacb22dea8fb86850abc149b768ee428db /ast-to-instr/src/Waveforms.java | |
| parent | 0362751e41f731b22b7bfe511af4aa71a02be70a (diff) | |
Starting a Java implementation of ast-to-instr.
Keeping things clean, this time.
Diffstat (limited to 'ast-to-instr/src/Waveforms.java')
| -rw-r--r-- | ast-to-instr/src/Waveforms.java | 30 |
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; + } +} |


