Top Description Inners Fields Constructors Methods
com.ibm.icu.util

public final Class BytesTrie

extends Object
implements Cloneable, Iterable<BytesTrie.Entry>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable, java.lang.Cloneable
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.ArrayList, .NoSuchElementException

Light-weight, non-const reader class for a BytesTrie. Traverses a byte-serialized data structure with minimal state, for mapping byte sequences to non-negative integer values.

This class is not intended for public subclassing.

Author
Markus W. Scherer
ICU Status
Stable since ICU 4.8.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
BytesTrie.Entry

Return value type for the Iterator.

public static class
BytesTrie.Iterator

Iterator for all of the (byte sequence, value) pairs in a BytesTrie.

public static enum
BytesTrie.Result

Return values for BytesTrie.next(), CharsTrie.next() and similar methods.

public static class
BytesTrie.State

BytesTrie state object, for saving a trie's current state and resetting the trie back to this state later.

Field Summary

Modifier and TypeField and Description
private byte[]
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
pack-priv static final int
private static final int
private int
private int
private int
private static BytesTrie.Result[]

Constructor Summary

AccessConstructor and Description
public
BytesTrie(byte[]
Bytes array that contains the serialized trie.
trieBytes
,
int
Root offset of the trie in the array.
offset
)

Constructs a BytesTrie reader instance.

public
BytesTrie(BytesTrie other)

Copy constructor.

Method Summary

Modifier and TypeMethod and Description
private static void
append(Appendable out, int c)

private BytesTrie.Result
branchNext(int pos, int length, int inByte)

public BytesTrie

Returns:

A shallow clone of this trie.
clone
()

Overrides java.lang.Object.clone.

Clones this trie reader object and its state, but not the byte array which will be shared.
public BytesTrie.Result

Returns:

The match/value Result.
current
()

Determines whether the byte sequence so far matches, whether it has a value, and whether another input byte can continue a matching byte sequence.

private static long
findUniqueValue(byte[] bytes, int pos, long uniqueValue)

private static long
findUniqueValueFromBranch(byte[] bytes, int pos, int length, long uniqueValue)

public BytesTrie.Result

Returns:

The match/value Result.
first
(int
Input byte value. Values -0x100..-1 are treated like 0..0xff. Values below -0x100 and above 0xff will never match.
inByte
)

Traverses the trie from the initial state for this input byte.

private static void
getNextBranchBytes(byte[] bytes, int pos, int length, Appendable out)

public int

Returns:

The number of bytes which continue the byte sequence from here.
getNextBytes
(Appendable
Each next byte is 0-extended to a char and appended to this object. (Only uses the out.append(c) method.)
out
)

Finds each byte which continues the byte sequence from the current state.

public long

Returns:

opaque state value
getState64
()

Returns the state of this trie as a 64-bit integer.

public long

Returns:

The unique value in bits 32..1 with bit 0 set, if all byte sequences reachable from the current state map to the same value; otherwise returns 0.
getUniqueValue
()

Determines whether all byte sequences reachable from the current state map to the same value, and if so, returns that value.

public int

Returns:

The value for the byte sequence so far.
getValue
()

Returns a matching byte sequence's value if called immediately after current()/first()/next() returned Result.INTERMEDIATE_VALUE or Result.FINAL_VALUE.

public BytesTrie.Iterator

Returns:

A new BytesTrie.Iterator.
iterator
()

Implements java.lang.Iterable.iterator.

Iterates from the current state of this trie.
public BytesTrie.Iterator

Returns:

A new BytesTrie.Iterator.
iterator
(int
If 0, the iterator returns full strings/byte sequences. Otherwise, the iterator returns strings with this maximum length.
maxStringLength
)

Iterates from the current state of this trie.

public static BytesTrie.Iterator

Returns:

A new BytesTrie.Iterator.
iterator
(byte[]
Bytes array that contains the serialized trie.
trieBytes
,
int
Root offset of the trie in the array.
offset
,
int
If 0, the iterator returns full strings/byte sequences. Otherwise, the iterator returns strings with this maximum length.
maxStringLength
)

Iterates from the root of a byte-serialized BytesTrie.

public static int
jumpByDelta(byte[] bytes, int pos)

Deprecated This API is ICU internal only.
Reads a jump delta and jumps.
public BytesTrie.Result

Returns:

The match/value Result.
next
(int
Input byte value. Values -0x100..-1 are treated like 0..0xff. Values below -0x100 and above 0xff will never match.
inByte
)

Traverses the trie from the current state for this input byte.

public BytesTrie.Result

Returns:

The match/value Result.
next
(byte[]
Contains a string or byte sequence.
s
,
int
The start index of the byte sequence in s.
sIndex
,
int
The (exclusive) end index of the byte sequence in s.
sLimit
)

Traverses the trie from the current state for this byte sequence.

private BytesTrie.Result
nextImpl(int pos, int inByte)

private static int
readValue(byte[] bytes, int pos, int leadByte)

public BytesTrie

Returns:

this
reset
()

Resets this trie to its initial state.

public BytesTrie

Returns:

this
resetToState
(BytesTrie.State
The State object which holds a saved trie state.
state
)

Resets this trie to the saved state.

public BytesTrie

Returns:

this
resetToState64
(long
The opaque trie state value from getState64().
state
)

Resets this trie to the saved state.

public BytesTrie

Returns:

this
saveState
(BytesTrie.State
The State object to hold the trie's state.
state
)

Saves the state of this trie.

private static int
skipDelta(byte[] bytes, int pos)

private static int
skipValue(int pos, int leadByte)

private static int
skipValue(byte[] bytes, int pos)

private void
stop()

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytes_back to summary
private byte[] bytes_
kFiveByteDeltaLeadback to summary
pack-priv static final int kFiveByteDeltaLead
kFiveByteValueLeadback to summary
pack-priv static final int kFiveByteValueLead
kFourByteDeltaLeadback to summary
pack-priv static final int kFourByteDeltaLead
kFourByteValueLeadback to summary
pack-priv static final int kFourByteValueLead
kMaxBranchLinearSubNodeLengthback to summary
pack-priv static final int kMaxBranchLinearSubNodeLength
kMaxLinearMatchLengthback to summary
pack-priv static final int kMaxLinearMatchLength
kMaxOneByteDeltaback to summary
pack-priv static final int kMaxOneByteDelta
kMaxOneByteValueback to summary
pack-priv static final int kMaxOneByteValue
kMaxThreeByteDeltaback to summary
pack-priv static final int kMaxThreeByteDelta
kMaxThreeByteValueback to summary
pack-priv static final int kMaxThreeByteValue
kMaxTwoByteDeltaback to summary
pack-priv static final int kMaxTwoByteDelta
kMaxTwoByteValueback to summary
pack-priv static final int kMaxTwoByteValue
kMinLinearMatchback to summary
pack-priv static final int kMinLinearMatch
kMinOneByteValueLeadback to summary
pack-priv static final int kMinOneByteValueLead
kMinThreeByteDeltaLeadback to summary
pack-priv static final int kMinThreeByteDeltaLead
kMinThreeByteValueLeadback to summary
pack-priv static final int kMinThreeByteValueLead
kMinTwoByteDeltaLeadback to summary
pack-priv static final int kMinTwoByteDeltaLead
kMinTwoByteValueLeadback to summary
pack-priv static final int kMinTwoByteValueLead
kMinValueLeadback to summary
pack-priv static final int kMinValueLead
kValueIsFinalback to summary
private 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.Result[] valueResults_

Constructor Detail

BytesTrieback to summary
public BytesTrie(byte[] trieBytes, int offset)

Constructs a BytesTrie reader instance.

The array must contain a copy of a byte sequence from the BytesTrieBuilder, with the offset indicating the first byte of that sequence. The BytesTrie object will not read more bytes than the BytesTrieBuilder generated in the corresponding build() call.

The array is not copied/cloned and must not be modified while the BytesTrie object is in use.

Parameters
trieBytes:byte[]

Bytes array that contains the serialized trie.

offset:int

Root offset of the trie in the array.

ICU Status
Stable since ICU 4.8.
BytesTrieback to summary
public BytesTrie(BytesTrie other)

Copy constructor. Makes a shallow copy of the other trie reader object and its state. Does not copy the byte array which will be shared. Same as clone() but without the throws clause.

ICU Status
Stable since ICU 64.

Method Detail

appendback to summary
private static void append(Appendable out, int c)
branchNextback to summary
private BytesTrie.Result branchNext(int pos, int length, int inByte)
cloneback to summary
public BytesTrie clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Clones this trie reader object and its state, but not the byte array which will be shared.

Returns:BytesTrie

A shallow clone of this trie.

Annotations
@Override
Exceptions
CloneNotSupportedException:

Doc from java.lang.Object.clone.

if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

ICU Status
Stable since ICU 4.8.
currentback to summary
public BytesTrie.Result current()

Determines whether the byte sequence so far matches, whether it has a value, and whether another input byte can continue a matching byte sequence.

Returns:BytesTrie.Result

The match/value Result.

ICU Status
Stable since ICU 4.8.
findUniqueValueback to summary
private static long findUniqueValue(byte[] bytes, int pos, long uniqueValue)
findUniqueValueFromBranchback to summary
private static long findUniqueValueFromBranch(byte[] bytes, int pos, int length, long uniqueValue)
firstback to summary
public BytesTrie.Result first(int inByte)

Traverses the trie from the initial state for this input byte. Equivalent to reset().next(inByte).

Parameters
inByte:int

Input byte value. Values -0x100..-1 are treated like 0..0xff. Values below -0x100 and above 0xff will never match.

Returns:BytesTrie.Result

The match/value Result.

ICU Status
Stable since ICU 4.8.
getNextBranchBytesback to summary
private static void getNextBranchBytes(byte[] bytes, int pos, int length, Appendable out)
getNextBytesback to summary
public int getNextBytes(Appendable out)

Finds each byte which continues the byte sequence from the current state. That is, each byte b for which it would be next(b)!=Result.NO_MATCH now.

Parameters
out:Appendable

Each next byte is 0-extended to a char and appended to this object. (Only uses the out.append(c) method.)

Returns:int

The number of bytes which continue the byte sequence from here.

ICU Status
Stable since ICU 4.8.
getState64back to summary
public long getState64()

Returns the state of this trie as a 64-bit integer. The state value is never 0.

Returns:long

opaque state value

ICU Status
Stable since ICU 64.
See Also
resetToState64
getUniqueValueback to summary
public long getUniqueValue()

Determines whether all byte sequences reachable from the current state map to the same value, and if so, returns that value.

Returns:long

The unique value in bits 32..1 with bit 0 set, if all byte sequences reachable from the current state map to the same value; otherwise returns 0.

ICU Status
Stable since ICU 4.8.
getValueback to summary
public int getValue()

Returns a matching byte sequence'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!

Returns:int

The value for the byte sequence so far.

ICU Status
Stable since ICU 4.8.
iteratorback to summary
public BytesTrie.Iterator iterator()

Implements java.lang.Iterable.iterator.

Iterates from the current state of this trie.

Returns:BytesTrie.Iterator

A new BytesTrie.Iterator.

Annotations
@Override
ICU Status
Stable since ICU 4.8.
iteratorback to summary
public BytesTrie.Iterator iterator(int maxStringLength)

Iterates from the current state of this trie.

Parameters
maxStringLength:int

If 0, the iterator returns full strings/byte sequences. Otherwise, the iterator returns strings with this maximum length.

Returns:BytesTrie.Iterator

A new BytesTrie.Iterator.

ICU Status
Stable since ICU 4.8.
iteratorback to summary
public static BytesTrie.Iterator iterator(byte[] trieBytes, int offset, int maxStringLength)

Iterates from the root of a byte-serialized BytesTrie.

Parameters
trieBytes:byte[]

Bytes array that contains the serialized trie.

offset:int

Root offset of the trie in the array.

maxStringLength:int

If 0, the iterator returns full strings/byte sequences. Otherwise, the iterator returns strings with this maximum length.

Returns:BytesTrie.Iterator

A new BytesTrie.Iterator.

ICU Status
Stable since ICU 4.8.
jumpByDeltaback to summary
public static int jumpByDelta(byte[] bytes, int pos)

Deprecated

This API is ICU internal only.

Reads a jump delta and jumps.

Annotations
@Deprecated
ICU Status
Internal ICU component.
nextback to summary
public BytesTrie.Result next(int inByte)

Traverses the trie from the current state for this input byte.

Parameters
inByte:int

Input byte value. Values -0x100..-1 are treated like 0..0xff. Values below -0x100 and above 0xff will never match.

Returns:BytesTrie.Result

The match/value Result.

ICU Status
Stable since ICU 4.8.
nextback to summary
public BytesTrie.Result next(byte[] s, int sIndex, int sLimit)

Traverses the trie from the current state for this byte sequence. Equivalent to

Result result=current();
for(each c in s)
  if(!result.hasNext()) return Result.NO_MATCH;
  result=next(c);
return result;
Parameters
s:byte[]

Contains a string or byte sequence.

sIndex:int

The start index of the byte sequence in s.

sLimit:int

The (exclusive) end index of the byte sequence in s.

Returns:BytesTrie.Result

The match/value Result.

ICU Status
Stable since ICU 4.8.
nextImplback to summary
private BytesTrie.Result nextImpl(int pos, int inByte)
readValueback to summary
private static int readValue(byte[] bytes, int pos, int leadByte)
resetback to summary
public BytesTrie reset()

Resets this trie to its initial state.

Returns:BytesTrie

this

ICU Status
Stable since ICU 4.8.
resetToStateback to summary
public BytesTrie resetToState(BytesTrie.State state)

Resets this trie to the saved state. Slower than resetToState64(long) which does not validate the state value.

Parameters
state:BytesTrie.State

The State object which holds a saved trie state.

Returns:BytesTrie

this

Exceptions
IllegalArgumentException:
if the state object contains no state, or the state of a different trie
ICU Status
Stable since ICU 4.8.
See Also
saveState, reset
resetToState64back to summary
public BytesTrie resetToState64(long state)

Resets this trie to the saved state. Unlike resetToState(State), the 64-bit state value must be from getState64() from the same trie object or from one initialized the exact same way. Because of no validation, this method is faster.

Parameters
state:long

The opaque trie state value from getState64().

Returns:BytesTrie

this

ICU Status
Stable since ICU 64.
See Also
getState64, resetToState, reset
saveStateback to summary
public BytesTrie saveState(BytesTrie.State state)

Saves the state of this trie.

Parameters
state:BytesTrie.State

The State object to hold the trie's state.

Returns:BytesTrie

this

ICU Status
Stable since ICU 4.8.
See Also
resetToState
skipDeltaback to summary
private static int skipDelta(byte[] bytes, int pos)
skipValueback to summary
private static int skipValue(int pos, int leadByte)
skipValueback to summary
private static int skipValue(byte[] bytes, int pos)
stopback to summary
private void stop()
com.ibm.icu.util back to summary

public final Class BytesTrie.Entry

extends Object
Class Inheritance

Return value type for the Iterator.
ICU Status
Stable since ICU 4.8.

Field Summary

Modifier and TypeField and Description
private byte[]
private int
public int
value

The value associated with the byte sequence.

Constructor Summary

AccessConstructor and Description
private
Entry(int capacity)

Method Summary

Modifier and TypeMethod and Description
private void
append(byte b)

private void
append(byte[] b, int off, int len)

public byte

Returns:

The index-th byte sequence byte.
byteAt
(int
An index into the byte sequence.
index
)

Returns a byte of the byte sequence.

public ByteBuffer

Returns:

The byte sequence as a read-only ByteBuffer.
bytesAsByteBuffer
()

public int

Returns:

The length of the byte sequence.
bytesLength
()

public void
copyBytesTo(byte[]
Destination byte array.
dest
,
int
Starting offset to where in dest the byte sequence is copied.
destOffset
)

Copies the byte sequence into a byte array.

private void
ensureCapacity(int len)

private void
truncateString(int newLength)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytesback to summary
private byte[] bytes
lengthback to summary
private int length
valueback to summary
public int value

The value associated with the byte sequence.

ICU Status
Stable since ICU 4.8.

Constructor Detail

Entryback to summary
private Entry(int capacity)

Method Detail

appendback to summary
private void append(byte b)
appendback to summary
private void append(byte[] b, int off, int len)
byteAtback to summary
public byte byteAt(int index)

Returns a byte of the byte sequence.

Parameters
index:int

An index into the byte sequence.

Returns:byte

The index-th byte sequence byte.

ICU Status
Stable since ICU 4.8.
bytesAsByteBufferback to summary
public ByteBuffer bytesAsByteBuffer()
Returns:ByteBuffer

The byte sequence as a read-only ByteBuffer.

ICU Status
Stable since ICU 4.8.
bytesLengthback to summary
public int bytesLength()
Returns:int

The length of the byte sequence.

ICU Status
Stable since ICU 4.8.
copyBytesToback to summary
public void copyBytesTo(byte[] dest, int destOffset)

Copies the byte sequence into a byte array.

Parameters
dest:byte[]

Destination byte array.

destOffset:int

Starting offset to where in dest the byte sequence is copied.

ICU Status
Stable since ICU 4.8.
ensureCapacityback to summary
private void ensureCapacity(int len)
truncateStringback to summary
private void truncateString(int newLength)
com.ibm.icu.util back to summary

public final Class BytesTrie.Iterator

extends Object
implements Iterator<BytesTrie.Entry>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Iterator for all of the (byte sequence, value) pairs in a BytesTrie.
ICU Status
Stable since ICU 4.8.

Field Summary

Modifier and TypeField and Description
private byte[]
private BytesTrie.Entry
private int
private int
private int
private int
private int
private ArrayList<Long>

Constructor Summary

AccessConstructor and Description
private
Iterator(byte[] trieBytes, int offset, int remainingMatchLength, int maxStringLength)

Method Summary

Modifier and TypeMethod and Description
private int
branchNext(int pos, int length)

public boolean

Returns:

true if there are more elements.
hasNext
()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
public BytesTrie.Entry

Returns:

An Entry with the string and value of the next element.
next
()

Implements java.util.Iterator.next.

Finds the next (byte sequence, value) pair if there is one.
public void
remove()

Overrides default java.util.Iterator.remove.

Iterator.remove() is not supported.
public BytesTrie.Iterator

Returns:

this
reset
()

Resets this iterator to its initial state.

private BytesTrie.Entry
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytes_back to summary
private byte[] bytes_
entry_back to summary
private BytesTrie.Entry entry_
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_
stack_back to summary
private ArrayList<Long> stack_

Constructor Detail

Iteratorback to summary
private Iterator(byte[] trieBytes, int offset, int remainingMatchLength, int maxStringLength)

Method Detail

branchNextback to summary
private int branchNext(int pos, int length)
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if there are more elements.

Annotations
@Override
ICU Status
Stable since ICU 4.8.
nextback to summary
public BytesTrie.Entry next()

Implements java.util.Iterator.next.

Finds the next (byte sequence, value) pair if there is one. If the byte sequence 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.

Returns:BytesTrie.Entry

An Entry with the string and value of the next element.

Annotations
@Override
Exceptions
NoSuchElementException:
- iteration has no more elements.
ICU Status
Stable since ICU 4.8.
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Iterator.remove() is not supported.

Annotations
@Override
Exceptions
UnsupportedOperationException:
(always)
ICU Status
Stable since ICU 4.8.
resetback to summary
public BytesTrie.Iterator reset()

Resets this iterator to its initial state.

Returns:BytesTrie.Iterator

this

ICU Status
Stable since ICU 4.8.
truncateAndStopback to summary
private BytesTrie.Entry truncateAndStop()
com.ibm.icu.util back to summary

public final Enum BytesTrie.Result

extends Enum<BytesTrie.Result>
Class Inheritance

Return values for BytesTrie.next(), CharsTrie.next() and similar methods.
ICU Status
Stable since ICU 4.8.

Field Summary

Modifier and TypeField and Description
public static final BytesTrie.Result
FINAL_VALUE

The input unit(s) continued a matching string and there is a value for the string so far.

public static final BytesTrie.Result
INTERMEDIATE_VALUE

The input unit(s) continued a matching string and there is a value for the string so far.

public static final BytesTrie.Result
NO_MATCH

The input unit(s) did not continue a matching string.

public static final BytesTrie.Result
NO_VALUE

The input unit(s) continued a matching string but there is no value for the string so far.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if another input byte/unit can continue a matching string.
hasNext
()

Equivalent to (result==NO_VALUE || result==INTERMEDIATE_VALUE).

public boolean

Returns:

true if there is a value for the input bytes/units so far.
hasValue
()

Equivalent to (result==INTERMEDIATE_VALUE || result==FINAL_VALUE).

public boolean

Returns:

true if the input bytes/units so far are part of a matching string/byte sequence.
matches
()

Same as (result!=NO_MATCH).

public static BytesTrie.Result
public static BytesTrie.Result[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

FINAL_VALUEback to summary
public static final BytesTrie.Result FINAL_VALUE

The input unit(s) continued a matching string and there is a value for the string so far. This value will be returned by getValue(). No further input byte/unit can continue a matching string.

ICU Status
Stable since ICU 4.8.
INTERMEDIATE_VALUEback to summary
public static final BytesTrie.Result INTERMEDIATE_VALUE

The input unit(s) continued a matching string and there is a value for the string so far. This value will be returned by getValue(). Another input byte/unit can continue a matching string.

ICU Status
Stable since ICU 4.8.
NO_MATCHback to summary
public static final BytesTrie.Result NO_MATCH

The input unit(s) did not continue a matching string. Once current()/next() return NO_MATCH, all further calls to current()/next() will also return NO_MATCH, until the trie is reset to its original state or to a saved state.

ICU Status
Stable since ICU 4.8.
NO_VALUEback to summary
public static final BytesTrie.Result NO_VALUE

The input unit(s) continued a matching string but there is no value for the string so far. (It is a prefix of a longer string.)

ICU Status
Stable since ICU 4.8.

Constructor Detail

Resultback to summary
private Result()

Method Detail

hasNextback to summary
public boolean hasNext()

Equivalent to (result==NO_VALUE || result==INTERMEDIATE_VALUE).

Returns:boolean

true if another input byte/unit can continue a matching string.

ICU Status
Stable since ICU 4.8.
hasValueback to summary
public boolean hasValue()

Equivalent to (result==INTERMEDIATE_VALUE || result==FINAL_VALUE).

Returns:boolean

true if there is a value for the input bytes/units so far.

ICU Status
Stable since ICU 4.8.
See Also
getValue
matchesback to summary
public boolean matches()

Same as (result!=NO_MATCH).

Returns:boolean

true if the input bytes/units so far are part of a matching string/byte sequence.

ICU Status
Stable since ICU 4.8.
valueOfback to summary
public static BytesTrie.Result valueOf(String name)
valuesback to summary
public static BytesTrie.Result[] values()
com.ibm.icu.util back to summary

public final Class BytesTrie.State

extends Object
Class Inheritance

BytesTrie state object, for saving a trie's current state and resetting the trie back to this state later.
ICU Status
Stable since ICU 4.8.

Field Summary

Modifier and TypeField and Description
private byte[]
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
State()

Constructs an empty State.

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytesback to summary
private byte[] bytes
posback to summary
private int pos
remainingMatchLengthback to summary
private int remainingMatchLength
rootback to summary
private int root

Constructor Detail

Stateback to summary
public State()

Constructs an empty State.

ICU Status
Stable since ICU 4.8.