ICU 54.1 54.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
icu::StringTrieBuilder Class Reference

Base class for string trie builder classes. More...

`#include <stringtriebuilder.h>`

Inheritance diagram for icu::StringTrieBuilder:

## Data Structures
class | BranchHeadNode
class | BranchNode
class | FinalValueNode
class | IntermediateValueNode
class | LinearMatchNode
class | ListBranchNode
class | Node
class | SplitBranchNode
class | ValueNode

## Static Public Member Functions
static UBool | hashNode (const void *node)
static UBool | equalNodes (const void *left, const void *right)

## Protected Member Functions
| StringTrieBuilder ()
virtual | ~StringTrieBuilder ()
void | createCompactBuilder (int32_t sizeGuess, UErrorCode &errorCode)
void | deleteCompactBuilder ()
void | build (UStringTrieBuildOption buildOption, int32_t elementsLength, UErrorCode &errorCode)
int32_t | writeNode (int32_t start, int32_t limit, int32_t unitIndex)
int32_t | writeBranchSubNode (int32_t start, int32_t limit, int32_t unitIndex, int32_t length)
Node * | makeNode (int32_t start, int32_t limit, int32_t unitIndex, UErrorCode &errorCode)
Node * | makeBranchSubNode (int32_t start, int32_t limit, int32_t unitIndex, int32_t length, UErrorCode &errorCode)
virtual int32_t | getElementStringLength (int32_t i) const =0
virtual UChar | getElementUnit (int32_t i, int32_t unitIndex) const =0
virtual int32_t | getElementValue (int32_t i) const =0
virtual int32_t | getLimitOfLinearMatch (int32_t first, int32_t last, int32_t unitIndex) const =0
virtual int32_t | countElementUnits (int32_t start, int32_t limit, int32_t unitIndex) const =0
virtual int32_t | skipElementsBySomeUnits (int32_t i, int32_t unitIndex, int32_t count) const =0
virtual int32_t | indexOfElementWithNextUnit (int32_t i, int32_t unitIndex, UChar unit) const =0
virtual UBool | matchNodesCanHaveValues () const =0
virtual int32_t | getMaxBranchLinearSubNodeLength () const =0
virtual int32_t | getMinLinearMatch () const =0
virtual int32_t | getMaxLinearMatchLength () const =0
Node * | registerNode (Node *newNode, UErrorCode &errorCode)
| Makes sure that there is only one unique node registered that is equivalent to newNode.
Node * | registerFinalValue (int32_t value, UErrorCode &errorCode)
| Makes sure that there is only one unique FinalValueNode registered with this value.
virtual Node * | createLinearMatchNode (int32_t i, int32_t unitIndex, int32_t length, Node *nextNode) const =0
virtual int32_t | write (int32_t unit)=0
virtual int32_t | writeElementUnits (int32_t i, int32_t unitIndex, int32_t length)=0
virtual int32_t | writeValueAndFinal (int32_t i, UBool isFinal)=0
virtual int32_t | writeValueAndType (UBool hasValue, int32_t value, int32_t node)=0
virtual int32_t | writeDeltaTo (int32_t jumpTarget)=0

## Protected Attributes
UHashtable * | nodes

## Static Protected Attributes
static const int32_t | kMaxBranchLinearSubNodeLength = 5
static const int32_t | kMaxSplitBranchLevels = 14

## Additional Inherited Members
Public Member Functions inherited from icu::UObject
virtual | ~UObject ()
| Destructor.
virtual UClassID | getDynamicClassID () const
| ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.

## Detailed Description

Base class for string trie builder classes.

This class is not intended for public subclassing.

Stable:
  ICU 4.8

Definition at line 61 of file stringtriebuilder.h.

## Constructor & Destructor Documentation

icu::StringTrieBuilder::StringTrieBuilder | ( |  | ) |
| protected

Internal:
  Do not use. This API is for internal use only.

virtual icu::StringTrieBuilder::~StringTrieBuilder | ( |  | ) |
| protected virtual

Internal:
  Do not use. This API is for internal use only.

## Member Function Documentation

void icu::StringTrieBuilder::build | ( | UStringTrieBuildOption | buildOption,
|  | int32_t | elementsLength,
|  | UErrorCode & | errorCode
| ) |  |
| protected

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::countElementUnits | ( | int32_t | start,
|  | int32_t | limit,
|  | int32_t | unitIndex
| ) |  | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

void icu::StringTrieBuilder::createCompactBuilder | ( | int32_t | sizeGuess,
|  | UErrorCode & | errorCode
| ) |  |
| protected

Internal:
  Do not use. This API is for internal use only.

virtual Node* icu::StringTrieBuilder::createLinearMatchNode | ( | int32_t | i,
|  | int32_t | unitIndex,
|  | int32_t | length,
|  | Node * | nextNode
| ) |  | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

void icu::StringTrieBuilder::deleteCompactBuilder | ( |  | ) |
| protected

Internal:
  Do not use. This API is for internal use only.

static UBool icu::StringTrieBuilder::equalNodes | ( | const void * | left,
|  | const void * | right
| ) |  |
| static

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::getElementStringLength | ( | int32_t | i | ) | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

virtual UChar icu::StringTrieBuilder::getElementUnit | ( | int32_t | i,
|  | int32_t | unitIndex
| ) |  | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::getElementValue | ( | int32_t | i | ) | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::getLimitOfLinearMatch | ( | int32_t | first,
|  | int32_t | last,
|  | int32_t | unitIndex
| ) |  | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::getMaxBranchLinearSubNodeLength | ( |  | ) | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::getMaxLinearMatchLength | ( |  | ) | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::getMinLinearMatch | ( |  | ) | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

static UBool icu::StringTrieBuilder::hashNode | ( | const void * | node | ) |
| static

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::indexOfElementWithNextUnit | ( | int32_t | i,
|  | int32_t | unitIndex,
|  | UChar | unit
| ) |  | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

Node* icu::StringTrieBuilder::makeBranchSubNode | ( | int32_t | start,
|  | int32_t | limit,
|  | int32_t | unitIndex,
|  | int32_t | length,
|  | UErrorCode & | errorCode
| ) |  |
| protected

Internal:
  Do not use. This API is for internal use only.

Node* icu::StringTrieBuilder::makeNode | ( | int32_t | start,
|  | int32_t | limit,
|  | int32_t | unitIndex,
|  | UErrorCode & | errorCode
| ) |  |
| protected

Internal:
  Do not use. This API is for internal use only.

virtual UBool icu::StringTrieBuilder::matchNodesCanHaveValues | ( |  | ) | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

Node* icu::StringTrieBuilder::registerFinalValue | ( | int32_t | value,
|  | UErrorCode & | errorCode
| ) |  |
| protected

Makes sure that there is only one unique FinalValueNode registered with this value.

Avoids creating a node if the value is a duplicate.

Parameters

  value | A final value.
  errorCode | ICU in/out UErrorCode. Set to U_MEMORY_ALLOCATION_ERROR if it was success but newNode==NULL.

Returns
  A FinalValueNode with the given value.

Internal:
  Do not use. This API is for internal use only.

Node* icu::StringTrieBuilder::registerNode | ( | Node * | newNode,
|  | UErrorCode & | errorCode
| ) |  |
| protected

Makes sure that there is only one unique node registered that is equivalent to newNode.

Parameters

  newNode | Input node. The builder takes ownership.
  errorCode | ICU in/out UErrorCode. Set to U_MEMORY_ALLOCATION_ERROR if it was success but newNode==NULL.

Returns
  newNode if it is the first of its kind, or an equivalent node if newNode is a duplicate.

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::skipElementsBySomeUnits | ( | int32_t | i,
|  | int32_t | unitIndex,
|  | int32_t | count
| ) |  | const
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::write | ( | int32_t | unit | ) |
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

int32_t icu::StringTrieBuilder::writeBranchSubNode | ( | int32_t | start,
|  | int32_t | limit,
|  | int32_t | unitIndex,
|  | int32_t | length
| ) |  |
| protected

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::writeDeltaTo | ( | int32_t | jumpTarget | ) |
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::writeElementUnits | ( | int32_t | i,
|  | int32_t | unitIndex,
|  | int32_t | length
| ) |  |
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

int32_t icu::StringTrieBuilder::writeNode | ( | int32_t | start,
|  | int32_t | limit,
|  | int32_t | unitIndex
| ) |  |
| protected

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::writeValueAndFinal | ( | int32_t | i,
|  | UBool | isFinal
| ) |  |
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

virtual int32_t icu::StringTrieBuilder::writeValueAndType | ( | UBool | hasValue,
|  | int32_t | value,
|  | int32_t | node
| ) |  |
| protected pure virtual

Internal:
  Do not use. This API is for internal use only.

## Field Documentation

const int32_t icu::StringTrieBuilder::kMaxBranchLinearSubNodeLength = 5
| static protected

Internal:
  Do not use. This API is for internal use only.

Definition at line 136 of file stringtriebuilder.h.

const int32_t icu::StringTrieBuilder::kMaxSplitBranchLevels = 14
| static protected

Internal:
  Do not use. This API is for internal use only.

Definition at line 141 of file stringtriebuilder.h.

UHashtable* icu::StringTrieBuilder::nodes
| protected

Internal:
  Do not use. This API is for internal use only.

Definition at line 185 of file stringtriebuilder.h.

The documentation for this class was generated from the following file:

- stringtriebuilder.h