summaryrefslogtreecommitdiff
blob: 3a408695e4a0fe6626e2fefede70aefa33a255a0 (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<String, String> FROM_WAVEFORM;

   static
   {
      FROM_WAVEFORM = new HashMap<String, String>();
   }

   private Waveforms () {} /* Utility class. */

   public static void register_map (final String wfm_id, final String elem_id)
   {
      FROM_WAVEFORM.put(wfm_id, elem_id);
   }

   public static String get_id_from_waveform_id (final String wfm_id)
   {
      final String result;

      result = FROM_WAVEFORM.get(wfm_id);

      if (result == null)
      {
         System.err.println
         (
            "[F] There is no element associated with waveform \""
            + wfm_id
            + "\". Is the model complete?"
         );

         System.exit(-1);
      }

      return result;
   }
}