ICU 56.1: icu::StringTrieBuilder::ListBranchNode Class Reference

ICU 56.1 56.1

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

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

Public Member Functions | Protected Attributes
icu::StringTrieBuilder::ListBranchNode Class Reference

`#include <stringtriebuilder.h>`

Inheritance diagram for icu::StringTrieBuilder::ListBranchNode:

## Public Member Functions
virtual UBool | operator== (const Node &other) const
virtual int32_t | markRightEdgesFirst (int32_t edgeNumber)
| Traverses the Node graph and numbers branch edges, with rightmost edges first. More...
virtual void | write (StringTrieBuilder &builder)
void | add (int32_t c, int32_t value)
void | add (int32_t c, Node *node)
Public Member Functions inherited from icu::StringTrieBuilder::BranchNode
| BranchNode (int32_t initialHash)
Public Member Functions inherited from icu::StringTrieBuilder::Node
| Node (int32_t initialHash)
int32_t | hashCode () const
UBool | operator!= (const Node &other) const
void | writeUnlessInsideRightEdge (int32_t firstRight, int32_t lastRight, StringTrieBuilder &builder)
int32_t | getOffset () const
Public Member Functions inherited from icu::UObject
virtual | ~UObject ()
| Destructor. More...
virtual UClassID | getDynamicClassID () const
| ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class. More...

## Protected Attributes
Node * | equal [kMaxBranchLinearSubNodeLength]
int32_t | length
int32_t | values [kMaxBranchLinearSubNodeLength]
UChar | units [kMaxBranchLinearSubNodeLength]
Protected Attributes inherited from icu::StringTrieBuilder::BranchNode
int32_t | firstEdgeNumber
Protected Attributes inherited from icu::StringTrieBuilder::Node
int32_t | hash
int32_t | offset

## Additional Inherited Members
Static Public Member Functions inherited from icu::StringTrieBuilder::Node
static int32_t | hashCode (const Node *node)

## Detailed Description

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

Definition at line 321 of file stringtriebuilder.h.

## Member Function Documentation

virtual int32_t icu::StringTrieBuilder::ListBranchNode::markRightEdgesFirst | ( | int32_t | edgeNumber | ) |
| virtual

Traverses the Node graph and numbers branch edges, with rightmost edges first.

This is to avoid writing a duplicate node twice.

Branch nodes in this trie data structure are not symmetric. Most branch edges "jump" to other nodes but the rightmost branch edges just continue without a jump. Therefore, write() must write the rightmost branch edge last (trie units are written backwards), and must write it at that point even if it is a duplicate of a node previously written elsewhere.

This function visits and marks right branch edges first. Edges are numbered with increasingly negative values because we share the offset field which gets positive values when nodes are written. A branch edge also remembers the first number for any of its edges.

When a further-left branch edge has a number in the range of the rightmost edge's numbers, then it will be written as part of the required right edge and we can avoid writing it first.

After root.markRightEdgesFirst(-1) the offsets of all nodes are negative edge numbers.

Parameters

  edgeNumber | The first edge number for this node and its sub-nodes.

Returns
  An edge number that is at least the maximum-negative of the input edge number and the numbers of this node and all of its sub-nodes.

Reimplemented from icu::StringTrieBuilder::Node.

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

- stringtriebuilder.h