summaryrefslogtreecommitdiff
blob: 7e86904e28951e2166369b258a93a06195770c88 (plain)
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
33
34
35
36
37
38
39
40
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);

         /* TODO: remove, it's for debug. */
         System.out.println
         (
            "[WFM] ("
            + source.get_value()
            + "->"
            + result.get_value()
            + ")"
         );
      }

      return result;
   }
}