public abstract class CodePointTrie extends CodePointMap
This class is not intended for public subclassing.
MutableCodePointTrie
CodePointMap.Range, CodePointMap.RangeOption, CodePointMap.StringIterator, CodePointMap.ValueFilter
Modifier and Type | Field and Description |
---|---|
protected com.ibm.icu.util.CodePointTrie.Data |
data
Deprecated.
This API is ICU internal only.
|
protected int |
dataLength
Deprecated.
This API is ICU internal only.
|
protected int |
highStart
Deprecated.
This API is ICU internal only.
|
Modifier and Type | Method and Description |
---|---|
int |
asciiGet(int c)
Returns a trie value for an ASCII code point, without range checking.
|
protected abstract int |
cpIndex(int c)
Deprecated.
This API is ICU internal only.
|
protected int |
fastIndex(int c)
Deprecated.
This API is ICU internal only.
|
static CodePointTrie |
fromBinary(CodePointTrie.Type type,
CodePointTrie.ValueWidth valueWidth,
ByteBuffer bytes)
Creates a trie from its binary form,
stored in the ByteBuffer starting at the current position.
|
int |
get(int c)
Returns the value for a code point as stored in the map, with range checking.
|
boolean |
getRange(int start,
CodePointMap.ValueFilter filter,
CodePointMap.Range range)
Sets the range object to a range of code points beginning with the start parameter.
|
abstract CodePointTrie.Type |
getType()
Returns the trie type.
|
CodePointTrie.ValueWidth |
getValueWidth()
Returns the number of bits in a trie data value.
|
protected int |
smallIndex(CodePointTrie.Type type,
int c)
Deprecated.
This API is ICU internal only.
|
int |
toBinary(OutputStream os)
Writes a representation of the trie to the output stream.
|
getRange, iterator, stringIterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
@Deprecated protected final com.ibm.icu.util.CodePointTrie.Data data
@Deprecated protected final int dataLength
@Deprecated protected final int highStart
public static CodePointTrie fromBinary(CodePointTrie.Type type, CodePointTrie.ValueWidth valueWidth, ByteBuffer bytes)
toBinary(OutputStream)
.
The data is copied from the buffer; later modification of the buffer will not affect the trie.
type
- selects the trie type; this method throws an exception
if the type does not match the binary data;
use null to accept any typevalueWidth
- selects the number of bits in a data value; this method throws an exception
if the valueWidth does not match the binary data;
use null to accept any data value widthbytes
- a buffer containing the binary data of a CodePointTrieMutableCodePointTrie(int, int)
,
MutableCodePointTrie.buildImmutable(CodePointTrie.Type, CodePointTrie.ValueWidth)
,
toBinary(OutputStream)
public abstract CodePointTrie.Type getType()
public final CodePointTrie.ValueWidth getValueWidth()
public int get(int c)
get
in class CodePointMap
c
- the code pointpublic final int asciiGet(int c)
c
- the input code point; must be U+0000..U+007Fpublic final boolean getRange(int start, CodePointMap.ValueFilter filter, CodePointMap.Range range)
If the CodePointMap.ValueFilter
parameter is not null, then
the value to be delivered is passed through that filter, and the return value is the end
of the range where all values are modified to the same actual value.
The value is unchanged if that parameter is null.
Example:
int start = 0; CodePointMap.Range range = new CodePointMap.Range(); while (map.getRange(start, null, range)) { int end = range.getEnd(); int value = range.getValue(); // Work with the range start..end and its value. start = end + 1; }
getRange
in class CodePointMap
start
- range startfilter
- an object that may modify the map data value,
or null if the values from the map are to be used unmodifiedrange
- the range object that will be set to the code point range and valuepublic final int toBinary(OutputStream os)
fromBinary(com.ibm.icu.util.CodePointTrie.Type, com.ibm.icu.util.CodePointTrie.ValueWidth, java.nio.ByteBuffer)
.os
- the output stream@Deprecated protected final int fastIndex(int c)
@Deprecated protected final int smallIndex(CodePointTrie.Type type, int c)
@Deprecated protected abstract int cpIndex(int c)
Copyright © 2016 Unicode, Inc. and others.