< prev index next >

src/java.base/share/classes/sun/text/normalizer/IntTrie.java

Print this page




  41 import java.io.DataInputStream;
  42 import java.io.IOException;
  43 import java.util.Arrays;
  44 
  45 /**
  46  * Trie implementation which stores data in int, 32 bits.
  47  * @author synwee
  48  * @see com.ibm.icu.impl.Trie
  49  * @since release 2.1, Jan 01 2002
  50  */
  51 public class IntTrie extends Trie
  52 {
  53     // public constructors ---------------------------------------------
  54 
  55     /**
  56     * <p>Creates a new Trie with the settings for the trie data.</p>
  57     * <p>Unserialize the 32-bit-aligned input stream and use the data for the
  58     * trie.</p>
  59     * @param inputStream file input stream to a ICU data file, containing
  60     *                    the trie
  61     * @param dataManipulate object which provides methods to parse the char
  62     *                        data
  63     * @throws IOException thrown when data reading fails
  64     * @draft 2.1
  65     */
  66     public IntTrie(InputStream inputStream, DataManipulate datamanipulate)
  67                                                     throws IOException
  68     {
  69         super(inputStream, datamanipulate);
  70         if (!isIntTrie()) {
  71             throw new IllegalArgumentException(
  72                                "Data given does not belong to a int trie.");
  73         }
  74     }
  75 
  76     // public methods --------------------------------------------------
  77 
  78     /**
  79     * Gets the value associated with the codepoint.
  80     * If no value is associated with the codepoint, a default value will be
  81     * returned.




  41 import java.io.DataInputStream;
  42 import java.io.IOException;
  43 import java.util.Arrays;
  44 
  45 /**
  46  * Trie implementation which stores data in int, 32 bits.
  47  * @author synwee
  48  * @see com.ibm.icu.impl.Trie
  49  * @since release 2.1, Jan 01 2002
  50  */
  51 public class IntTrie extends Trie
  52 {
  53     // public constructors ---------------------------------------------
  54 
  55     /**
  56     * <p>Creates a new Trie with the settings for the trie data.</p>
  57     * <p>Unserialize the 32-bit-aligned input stream and use the data for the
  58     * trie.</p>
  59     * @param inputStream file input stream to a ICU data file, containing
  60     *                    the trie
  61     * @param datamanipulate object which provides methods to parse the char
  62     *                        data
  63     * @throws IOException thrown when data reading fails
  64     * @draft 2.1
  65     */
  66     public IntTrie(InputStream inputStream, DataManipulate datamanipulate)
  67                                                     throws IOException
  68     {
  69         super(inputStream, datamanipulate);
  70         if (!isIntTrie()) {
  71             throw new IllegalArgumentException(
  72                                "Data given does not belong to a int trie.");
  73         }
  74     }
  75 
  76     // public methods --------------------------------------------------
  77 
  78     /**
  79     * Gets the value associated with the codepoint.
  80     * If no value is associated with the codepoint, a default value will be
  81     * returned.


< prev index next >