This class is not intended for public subclassing.
| Modifier and Type | Class and Description |
|---|---|
| public static class | CharsTrie.Entry
Return value type for the Iterator. |
| public static class | CharsTrie.Iterator
Iterator for all of the (string, value) pairs in a CharsTrie. |
| public static class | CharsTrie.State
CharsTrie state object, for saving a trie's current state and resetting the trie back to this state later. |
| Modifier and Type | Field and Description |
|---|---|
| private CharSequence | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| private int | |
| private int | |
| private int | |
| private static BytesTrie. |
| Access | Constructor and Description |
|---|---|
| public | CharsTrie(CharSequence
CharSequence that contains the serialized trie. trieChars, int Root offset of the trie in the CharSequence. offset)Constructs a CharsTrie reader instance. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| private BytesTrie. | |
| public CharsTrie | Returns: A shallow clone of this trie.Overrides java. |
| public BytesTrie. | Returns: The match/value Result.Determines whether the string so far matches, whether it has a value, and whether another input char can continue a matching string. |
| private static long | |
| private static long | |
| public BytesTrie. | Returns: The match/value Result.Input char value. Values below 0 and above 0xffff will never match. inUnit)Traverses the trie from the initial state for this input char. |
| public BytesTrie. | Returns: The match/value Result.A Unicode code point 0..0x10ffff. cp)Traverses the trie from the initial state for the one or two UTF-16 code units for this input code point. |
| private static void | |
| public int | Returns: The number of chars which continue the string from here.Each next char is appended to this object.
(Only uses the out.append(c) method.) out)Finds each char which continues the string from the current state. |
| public long | |
| public long | Returns: The unique value in bits 32..1 with bit 0 set, if all strings reachable from the current state map to the same value; otherwise returns 0.Determines whether all strings reachable from the current state map to the same value, and if so, returns that value. |
| public int | Returns: The value for the string so far.Returns a matching string's value if called immediately after current()/first()/next() returned Result.INTERMEDIATE_VALUE or Result.FINAL_VALUE. |
| public CharsTrie. | Returns: A new CharsTrie.Iterator.Implements java. |
| public CharsTrie. | Returns: A new CharsTrie.Iterator.If 0, the iterator returns full strings.
Otherwise, the iterator returns strings with this maximum length. maxStringLength)Iterates from the current state of this trie. |
| public static CharsTrie. | Returns: A new CharsTrie.Iterator.CharSequence that contains the serialized trie. trieChars, int Root offset of the trie in the CharSequence. offset, int If 0, the iterator returns full strings.
Otherwise, the iterator returns strings with this maximum length. maxStringLength)Iterates from the root of a char-serialized BytesTrie. |
| private static int | |
| public BytesTrie. | Returns: The match/value Result.Input char value. Values below 0 and above 0xffff will never match. inUnit)Traverses the trie from the current state for this input char. |
| public BytesTrie. | Returns: The match/value Result.Contains a string. s, int The start index of the string in s. sIndex, int The (exclusive) end index of the string in s. sLimit)Traverses the trie from the current state for this string. |
| public BytesTrie. | Returns: The match/value Result.A Unicode code point 0..0x10ffff. cp)Traverses the trie from the current state for the one or two UTF-16 code units for this input code point. |
| private BytesTrie. | |
| private static int | |
| private static int | |
| public CharsTrie | |
| public CharsTrie | Returns: thisThe State object which holds a saved trie state. stateResets this trie to the saved state. |
| public CharsTrie | Returns: thisThe opaque trie state value from getState64(). state)Resets this trie to the saved state. |
| public CharsTrie | |
| private static int | |
| private static int | |
| private static int | |
| private static int | |
| private void |
| chars_ | back to summary |
|---|---|
| private CharSequence chars_ | |
| kMaxBranchLinearSubNodeLength | back to summary |
|---|---|
| pack-priv static final int kMaxBranchLinearSubNodeLength | |
| kMaxLinearMatchLength | back to summary |
|---|---|
| pack-priv static final int kMaxLinearMatchLength | |
| kMaxOneUnitDelta | back to summary |
|---|---|
| pack-priv static final int kMaxOneUnitDelta | |
| kMaxOneUnitNodeValue | back to summary |
|---|---|
| pack-priv static final int kMaxOneUnitNodeValue | |
| kMaxOneUnitValue | back to summary |
|---|---|
| pack-priv static final int kMaxOneUnitValue | |
| kMaxTwoUnitDelta | back to summary |
|---|---|
| pack-priv static final int kMaxTwoUnitDelta | |
| kMaxTwoUnitNodeValue | back to summary |
|---|---|
| pack-priv static final int kMaxTwoUnitNodeValue | |
| kMaxTwoUnitValue | back to summary |
|---|---|
| pack-priv static final int kMaxTwoUnitValue | |
| kMinLinearMatch | back to summary |
|---|---|
| pack-priv static final int kMinLinearMatch | |
| kMinTwoUnitDeltaLead | back to summary |
|---|---|
| pack-priv static final int kMinTwoUnitDeltaLead | |
| kMinTwoUnitNodeValueLead | back to summary |
|---|---|
| pack-priv static final int kMinTwoUnitNodeValueLead | |
| kMinTwoUnitValueLead | back to summary |
|---|---|
| pack-priv static final int kMinTwoUnitValueLead | |
| kMinValueLead | back to summary |
|---|---|
| pack-priv static final int kMinValueLead | |
| kNodeTypeMask | back to summary |
|---|---|
| pack-priv static final int kNodeTypeMask | |
| kThreeUnitDeltaLead | back to summary |
|---|---|
| pack-priv static final int kThreeUnitDeltaLead | |
| kThreeUnitNodeValueLead | back to summary |
|---|---|
| pack-priv static final int kThreeUnitNodeValueLead | |
| kThreeUnitValueLead | back to summary |
|---|---|
| pack-priv static final int kThreeUnitValueLead | |
| kValueIsFinal | back to summary |
|---|---|
| pack-priv static final int kValueIsFinal | |
| pos_ | back to summary |
|---|---|
| private int pos_ | |
| remainingMatchLength_ | back to summary |
|---|---|
| private int remainingMatchLength_ | |
| root_ | back to summary |
|---|---|
| private int root_ | |
| valueResults_ | back to summary |
|---|---|
| private static BytesTrie. | |
| CharsTrie | back to summary |
|---|---|
| public CharsTrie(CharSequence trieChars, int offset) Constructs a CharsTrie reader instance. The CharSequence must contain a copy of a char sequence from the CharsTrieBuilder, with the offset indicating the first char of that sequence. The CharsTrie object will not read more chars than the CharsTrieBuilder generated in the corresponding build() call. The CharSequence is not copied/cloned and must not be modified while the CharsTrie object is in use.
| |
| CharsTrie | back to summary |
|---|---|
| public CharsTrie(CharsTrie other) Copy constructor. Makes a shallow copy of the other trie reader object and its state. Does not copy the char array which will be shared. Same as clone() but without the throws clause.
| |
| append | back to summary |
|---|---|
| private static void append(Appendable out, int c) | |
| branchNext | back to summary |
|---|---|
| private BytesTrie. | |
| clone | back to summary |
|---|---|
| public CharsTrie clone() throws CloneNotSupportedException Overrides java. Clones this trie reader object and its state, but not the char array which will be shared.
| |
| current | back to summary |
|---|---|
| public BytesTrie. Determines whether the string so far matches, whether it has a value, and whether another input char can continue a matching string. | |
| findUniqueValue | back to summary |
|---|---|
| private static long findUniqueValue(CharSequence chars, int pos, long uniqueValue) | |
| findUniqueValueFromBranch | back to summary |
|---|---|
| private static long findUniqueValueFromBranch(CharSequence chars, int pos, int length, long uniqueValue) | |
| first | back to summary |
|---|---|
| public BytesTrie. Traverses the trie from the initial state for this input char. Equivalent to reset().next(inUnit). | |
| firstForCodePoint | back to summary |
|---|---|
| public BytesTrie. Traverses the trie from the initial state for the one or two UTF-16 code units for this input code point. Equivalent to reset().nextForCodePoint(cp). | |
| getNextBranchChars | back to summary |
|---|---|
| private static void getNextBranchChars(CharSequence chars, int pos, int length, Appendable out) | |
| getNextChars | back to summary |
|---|---|
| public int getNextChars(Appendable out) Finds each char which continues the string from the current state. That is, each char c for which it would be next(c)!=Result.NO_MATCH now.
| |
| getState64 | back to summary |
|---|---|
| public long getState64() Returns the state of this trie as a 64-bit integer. The state value is never 0.
| |
| getUniqueValue | back to summary |
|---|---|
| public long getUniqueValue() Determines whether all strings reachable from the current state map to the same value, and if so, returns that value.
| |
| getValue | back to summary |
|---|---|
| public int getValue() Returns a matching string's value if called immediately after current()/first()/next() returned Result.INTERMEDIATE_VALUE or Result.FINAL_VALUE. getValue() can be called multiple times. Do not call getValue() after Result.NO_MATCH or Result.NO_VALUE!
| |
| iterator | back to summary |
|---|---|
| public CharsTrie. Implements java. Iterates from the current state of this trie. | |
| iterator | back to summary |
|---|---|
| public CharsTrie. Iterates from the current state of this trie. | |
| iterator | back to summary |
|---|---|
| public static CharsTrie. Iterates from the root of a char-serialized BytesTrie.
| |
| jumpByDelta | back to summary |
|---|---|
| private static int jumpByDelta(CharSequence chars, int pos) | |
| next | back to summary |
|---|---|
| public BytesTrie. Traverses the trie from the current state for this input char. | |
| next | back to summary |
|---|---|
| public BytesTrie. Traverses the trie from the current state for this string. Equivalent to Result result=current(); for(each c in s) if(!result.hasNext()) return Result.NO_MATCH; result=next(c); return result;
| |
| nextForCodePoint | back to summary |
|---|---|
| public BytesTrie. Traverses the trie from the current state for the one or two UTF-16 code units for this input code point. | |
| nextImpl | back to summary |
|---|---|
| private BytesTrie. | |
| readNodeValue | back to summary |
|---|---|
| private static int readNodeValue(CharSequence chars, int pos, int leadUnit) | |
| readValue | back to summary |
|---|---|
| private static int readValue(CharSequence chars, int pos, int leadUnit) | |
| reset | back to summary |
|---|---|
| public CharsTrie reset() Resets this trie to its initial state. | |
| resetToState | back to summary |
|---|---|
| public CharsTrie resetToState(CharsTrie. Resets this trie to the saved state.
Slower than | |
| resetToState64 | back to summary |
|---|---|
| public CharsTrie resetToState64(long state) Resets this trie to the saved state.
Unlike
| |
| saveState | back to summary |
|---|---|
| public CharsTrie saveState(CharsTrie. Saves the state of this trie.
| |
| skipDelta | back to summary |
|---|---|
| private static int skipDelta(CharSequence chars, int pos) | |
| skipNodeValue | back to summary |
|---|---|
| private static int skipNodeValue(int pos, int leadUnit) | |
| skipValue | back to summary |
|---|---|
| private static int skipValue(int pos, int leadUnit) | |
| skipValue | back to summary |
|---|---|
| private static int skipValue(CharSequence chars, int pos) | |
| stop | back to summary |
|---|---|
| private void stop() | |
| Modifier and Type | Field and Description |
|---|---|
| public CharSequence | chars
The string. |
| public int | value
The value associated with the string. |
| Access | Constructor and Description |
|---|---|
| private |
| chars | back to summary |
|---|---|
| public CharSequence chars The string.
| |
| value | back to summary |
|---|---|
| public int value The value associated with the string.
| |
| Entry | back to summary |
|---|---|
| private Entry() | |
| Modifier and Type | Field and Description |
|---|---|
| private CharSequence | |
| private CharsTrie. | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private boolean | |
| private ArrayList | |
| private StringBuilder |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| public boolean | Returns: true if there are more elements.Implements java. true if the iteration has more elements.
|
| public CharsTrie. | Returns: An Entry with the string and value of the next element.Implements java. |
| public void | |
| public CharsTrie. | |
| private CharsTrie. |
| chars_ | back to summary |
|---|---|
| private CharSequence chars_ | |
| entry_ | back to summary |
|---|---|
| private CharsTrie. | |
| initialPos_ | back to summary |
|---|---|
| private int initialPos_ | |
| initialRemainingMatchLength_ | back to summary |
|---|---|
| private int initialRemainingMatchLength_ | |
| maxLength_ | back to summary |
|---|---|
| private int maxLength_ | |
| pos_ | back to summary |
|---|---|
| private int pos_ | |
| remainingMatchLength_ | back to summary |
|---|---|
| private int remainingMatchLength_ | |
| skipValue_ | back to summary |
|---|---|
| private boolean skipValue_ | |
| stack_ | back to summary |
|---|---|
| private ArrayList<Long> stack_ | |
| str_ | back to summary |
|---|---|
| private StringBuilder str_ | |
| Iterator | back to summary |
|---|---|
| private Iterator(CharSequence trieChars, int offset, int remainingMatchLength, int maxStringLength) | |
| branchNext | back to summary |
|---|---|
| private int branchNext(int pos, int length) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns | |
| next | back to summary |
|---|---|
| public CharsTrie. Implements java. Finds the next (string, value) pair if there is one. If the string is truncated to the maximum length and does not have a real value, then the value is set to -1. In this case, this "not a real value" is indistinguishable from a real value of -1.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Iterator.remove() is not supported.
| |
| reset | back to summary |
|---|---|
| public CharsTrie. Resets this iterator to its initial state. | |
| truncateAndStop | back to summary |
|---|---|
| private CharsTrie. | |
| Modifier and Type | Field and Description |
|---|---|
| private CharSequence | |
| private int | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| chars | back to summary |
|---|---|
| private CharSequence chars | |
| pos | back to summary |
|---|---|
| private int pos | |
| remainingMatchLength | back to summary |
|---|---|
| private int remainingMatchLength | |
| root | back to summary |
|---|---|
| private int root | |
| State | back to summary |
|---|---|
| public State() Constructs an empty State.
| |