public class

CharTrie

extends Trie
java.lang.Object
   ↳ sun.text.normalizer.Trie
     ↳ sun.text.normalizer.CharTrie

Class Overview

Trie implementation which stores data in char, 16 bits.

See Also
  • com.ibm.icu.impl.Trie

Summary

Nested Classes
class CharTrie.FriendAgent Java friend implementation  
[Expand]
Inherited Constants
From class sun.text.normalizer.Trie
[Expand]
Inherited Fields
From class sun.text.normalizer.Trie
Public Constructors
CharTrie(InputStream inputStream, Trie.DataManipulate dataManipulate)

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

Public Methods
final char getCodePointValue(int ch)
Gets the value associated with the codepoint.
final char getLeadValue(char ch)
Gets the value to the data which this lead surrogate character points to.
final char getSurrogateValue(char lead, char trail)
Get the value associated with a pair of surrogates.
final char getTrailValue(int leadvalue, char trail)

Get a value from a folding offset (from the value of a lead surrogate) and a trail surrogate.

void putIndexData(UCharacterProperty friend)
Java friend implementation To store the index and data array into the argument.
Protected Methods
final int getInitialValue()
Gets the default initial value
final int getSurrogateOffset(char lead, char trail)
Gets the offset to the data which the surrogate pair points to.
final int getValue(int index)
Gets the value at the argument index.
final void unserialize(InputStream inputStream)

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

[Expand]
Inherited Methods
From class sun.text.normalizer.Trie
From class java.lang.Object

Public Constructors

public CharTrie (InputStream inputStream, Trie.DataManipulate dataManipulate)

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

Public Methods

public final char 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

public final char 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

public final char getSurrogateValue (char lead, char trail)

Get the value associated with a pair of surrogates.

Parameters
lead a lead surrogate
trail a trail surrogate

public final char getTrailValue (int leadvalue, char trail)

Get a value from a folding offset (from the value of a lead surrogate) and a trail surrogate.

If the

Parameters
leadvalue value associated with the lead surrogate which contains the folding offset
trail surrogate
Returns
  • trie data value associated with the trail character

public void putIndexData (UCharacterProperty friend)

Java friend implementation To store the index and data array into the argument.

Parameters
friend java friend UCharacterProperty object to store the array

Protected Methods

protected final int getInitialValue ()

Gets the default initial value

Returns
  • 32 bit value

protected final int getSurrogateOffset (char lead, char trail)

Gets the offset to the data which the surrogate pair points to.

Parameters
lead lead surrogate
trail trailing surrogate
Returns
  • offset to data

protected final int getValue (int index)

Gets the value at the argument index. For use internally in TrieIterator.

Parameters
index value at index will be retrieved
Returns
  • 32 bit value
See Also
  • com.ibm.icu.impl.TrieIterator

protected final void unserialize (InputStream inputStream)

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

Parameters
inputStream data input stream containing trie data
Throws
IOException thrown when data reading fails