aicas logoJamaica 3.2 release 62

sun.text.normalizer
Class IntTrie

java.lang.Object
  extended by sun.text.normalizer.Trie
      extended by sun.text.normalizer.IntTrie

public class IntTrie
extends Trie

Trie implementation which stores data in int, 32 bits.

Since:
release 2.1, Jan 01 2002
See Also:
com.ibm.icu.impl.Trie

Nested Class Summary
 
Nested classes/interfaces inherited from class sun.text.normalizer.Trie
Trie.DataManipulate
 
Field Summary
 
Fields inherited from class sun.text.normalizer.Trie
INDEX_STAGE_1_SHIFT_, INDEX_STAGE_2_SHIFT_, INDEX_STAGE_3_MASK_, LEAD_INDEX_OFFSET_, m_dataLength_, m_dataManipulate_, m_dataOffset_, m_index_, SURROGATE_MASK_
 
Constructor Summary
IntTrie(InputStream inputStream, Trie.DataManipulate datamanipulate)
          Creates a new Trie with the settings for the trie data.
 
Method Summary
 int getCodePointValue(int ch)
          Gets the value associated with the codepoint.
protected  int getInitialValue()
          Gets the default initial value
 int getLeadValue(char ch)
          Gets the value to the data which this lead surrogate character points to.
protected  int getSurrogateOffset(char lead, char trail)
          Gets the offset to the data which the surrogate pair points to.
 int getTrailValue(int leadvalue, char trail)
          Get a value from a folding offset (from the value of a lead surrogate) and a trail surrogate.
protected  int getValue(int index)
          Gets the value at the argument index.
protected  void unserialize(InputStream inputStream)
          Parses the input stream and stores its trie content into a index and data array
 
Methods inherited from class sun.text.normalizer.Trie
getBMPOffset, getCodePointOffset, getLeadOffset, getRawOffset, isCharTrie, isIntTrie
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntTrie

public IntTrie(InputStream inputStream,
               Trie.DataManipulate datamanipulate)
        throws IOException

Creates a new Trie with the settings for the trie data.

Unserialize the 32-bit-aligned input stream and use the data for the trie.

Parameters:
inputStream - file input stream to a ICU data file, containing the trie
dataManipulate - object which provides methods to parse the char data
Throws:
IOException - thrown when data reading fails
Method Detail

getCodePointValue

public final int getCodePointValue(int ch)
Gets the value associated with the codepoint. If no value is associated with the codepoint, a default value will be returned.

Parameters:
ch - codepoint
Returns:
offset to data

getLeadValue

public final int getLeadValue(char ch)
Gets the value to the data which this lead surrogate character points to. Returned data may contain folding offset information for the next trailing surrogate character. This method does not guarantee correct results for trail surrogates.

Parameters:
ch - lead surrogate character
Returns:
data value

getTrailValue

public final int getTrailValue(int leadvalue,
                               char trail)
Get a value from a folding offset (from the value of a lead surrogate) and a trail surrogate.

Parameters:
leadvalue - the value of a lead surrogate that contains the folding offset
trail - surrogate
Returns:
trie data value associated with the trail character

unserialize

protected final void unserialize(InputStream inputStream)
                          throws IOException

Parses the input stream and stores its trie content into a index and data array

Overrides:
unserialize in class Trie
Parameters:
inputStream - data input stream containing trie data
Throws:
IOException - thrown when data reading fails

getSurrogateOffset

protected final int getSurrogateOffset(char lead,
                                       char trail)
Gets the offset to the data which the surrogate pair points to.

Specified by:
getSurrogateOffset in class Trie
Parameters:
lead - lead surrogate
trail - trailing surrogate
Returns:
offset to data

getValue

protected final int getValue(int index)
Gets the value at the argument index. For use internally in TrieIterator

Specified by:
getValue in class Trie
Parameters:
index - value at index will be retrieved
Returns:
32 bit value
See Also:
com.ibm.icu.impl.TrieIterator

getInitialValue

protected final int getInitialValue()
Gets the default initial value

Specified by:
getInitialValue in class Trie
Returns:
32 bit value

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.