@@ -0,0 +1,1043 @@
+/**%0A * Copyright (C) 2015 The Authors.%0A */%0Apackage dk.itu.kelvin.util;%0A%0A// I/O utilities%0Aimport java.io.Serializable;%0A%0A/**%0A * String pool class.%0A *%0A * @see %3Ca href=%22http://en.wikipedia.org/wiki/String_interning%22%3E%0A *      http://en.wikipedia.org/wiki/String_interning%3C/a%3E%0A *%0A * @see %3Ca href=%22http://stackoverflow.com/a/10628759%22%3E%0A *      http://stackoverflow.com/a/10628759%3C/a%3E%0A */%0Apublic final class StringPool implements Serializable %7B%0A  /**%0A   * Internal map of strings.%0A   */%0A  private Map%3CString, String%3E pool = new HashTable%3C%3E();%0A%0A  /**%0A   * Get the interned version of the specified string, interning it if it's not%0A   * already in the pool.%0A   *%0A   * @param string  The string to get from the string pool.%0A   * @return        The interned string.%0A   */%0A  public String get(final String string) %7B%0A    if (string == null %7C%7C string.isEmpty()) %7B%0A      return string;%0A    %7D%0A%0A    if (!this.pool.containsKey(string)) %7B%0A      this.pool.put(string, string);%0A%0A      return string;%0A    %7D%0A    else %7B%0A      return this.pool.get(string);%0A    %7D%0A  %7D%0A%7D%0A

Implement manual string interning class.