summaryrefslogtreecommitdiff
blob: bc1778fa7ee030f0e5635f8d60f239ec5604a015 (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
import java.util.Map;
import java.util.HashMap;

public class Strings
{
   private static final Map<String, IDs> TO_ID;

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

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

   public static IDs get_id_from_string (final String string)
   {
      IDs result;

      result = TO_ID.get(string);

      if (result == null)
      {
         result = IDs.generate_new_id("string");

         TO_ID.put(string, result);
      }

      return result;
   }
}