Package com.ibm.icu.impl
Class RBBIDataWrapper
java.lang.Object
com.ibm.icu.impl.RBBIDataWrapper
Internal class used for Rule Based Break Iterators.
This class provides access to the compiled break rule data, as it is stored in a .brk file. Refer to the file common/rbbidata.h from ICU4C for further details.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
static final class
Data Header.static class
A RBBI State Transition table, the form of the data used at run time in Java. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
offset to the "accepting" field in a state table row.static final int
value constant for the ACCEPTING field of a state table row.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
int[]
private static final RBBIDataWrapper.IsAcceptable
static final int
offset to the "lookahead" field in a state table row.static final int
offset to the start of the next states array in a state table row.static final int
static final int
static final int
static final int
offset to the "tagIndex" field in a state table row. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
charToString
(char n, int width) void
dump
(PrintStream out) Debug function to display the break iterator data.private void
private void
dumpRow
(PrintStream out, RBBIDataWrapper.RBBIStateTable table, char state) Dump (for debug) a single row of an RBBI state tableprivate void
dumpTable
(PrintStream out, RBBIDataWrapper.RBBIStateTable table) Dump a state table.static boolean
Equals helper for state tables, including null handling.static RBBIDataWrapper
get
(ByteBuffer bytes) Get an RBBIDataWrapper from an InputStream onto a pre-compiled set of RBBI rules.int
getRowIndex
(int state) RBBI State Table Indexing Function.static String
intToHexString
(int n, int width) Fixed width int-to-string conversion.static String
intToString
(int n, int width) Fixed width int-to-string conversion.
-
Field Details
-
fHeader
-
fFTable
-
fRTable
-
fTrie
-
fRuleSource
-
fStatusTable
public int[] fStatusTable -
DATA_FORMAT
public static final int DATA_FORMAT- See Also:
-
FORMAT_VERSION
public static final int FORMAT_VERSION- See Also:
-
IS_ACCEPTABLE
-
DH_SIZE
public static final int DH_SIZE- See Also:
-
DH_MAGIC
public static final int DH_MAGIC- See Also:
-
DH_FORMATVERSION
public static final int DH_FORMATVERSION- See Also:
-
DH_LENGTH
public static final int DH_LENGTH- See Also:
-
DH_CATCOUNT
public static final int DH_CATCOUNT- See Also:
-
DH_FTABLE
public static final int DH_FTABLE- See Also:
-
DH_FTABLELEN
public static final int DH_FTABLELEN- See Also:
-
DH_RTABLE
public static final int DH_RTABLE- See Also:
-
DH_RTABLELEN
public static final int DH_RTABLELEN- See Also:
-
DH_TRIE
public static final int DH_TRIE- See Also:
-
DH_TRIELEN
public static final int DH_TRIELEN- See Also:
-
DH_RULESOURCE
public static final int DH_RULESOURCE- See Also:
-
DH_RULESOURCELEN
public static final int DH_RULESOURCELEN- See Also:
-
DH_STATUSTABLE
public static final int DH_STATUSTABLE- See Also:
-
DH_STATUSTABLELEN
public static final int DH_STATUSTABLELEN- See Also:
-
ACCEPTING
public static final int ACCEPTINGoffset to the "accepting" field in a state table row.- See Also:
-
LOOKAHEAD
public static final int LOOKAHEADoffset to the "lookahead" field in a state table row.- See Also:
-
TAGSIDX
public static final int TAGSIDXoffset to the "tagIndex" field in a state table row.- See Also:
-
NEXTSTATES
public static final int NEXTSTATESoffset to the start of the next states array in a state table row.- See Also:
-
ACCEPTING_UNCONDITIONAL
public static final int ACCEPTING_UNCONDITIONALvalue constant for the ACCEPTING field of a state table row.- See Also:
-
RBBI_LOOKAHEAD_HARD_BREAK
public static final int RBBI_LOOKAHEAD_HARD_BREAK- See Also:
-
RBBI_BOF_REQUIRED
public static final int RBBI_BOF_REQUIRED- See Also:
-
RBBI_8BITS_ROWS
public static final int RBBI_8BITS_ROWS- See Also:
-
-
Constructor Details
-
RBBIDataWrapper
RBBIDataWrapper()
-
-
Method Details
-
equals
public static boolean equals(RBBIDataWrapper.RBBIStateTable left, RBBIDataWrapper.RBBIStateTable right) Equals helper for state tables, including null handling. -
getRowIndex
public int getRowIndex(int state) RBBI State Table Indexing Function. Given a state number, return the array index of the start of the state table row for that state. -
get
Get an RBBIDataWrapper from an InputStream onto a pre-compiled set of RBBI rules.- Throws:
IOException
-
dump
Debug function to display the break iterator data. -
intToString
Fixed width int-to-string conversion. -
charToString
-
intToHexString
Fixed width int-to-string conversion. -
dumpTable
Dump a state table. (A full set of RBBI rules has 4 state tables.) -
dumpRow
Dump (for debug) a single row of an RBBI state table- Parameters:
table
-state
-
-
dumpCharCategories
-