Package com.ibm.icu.impl
Class RBBIDataWrapper
- java.lang.Object
-
- com.ibm.icu.impl.RBBIDataWrapper
-
public final class RBBIDataWrapper extends java.lang.Object
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 Classes Modifier and Type Class Description private static class
RBBIDataWrapper.IsAcceptable
static class
RBBIDataWrapper.RBBIDataHeader
Data Header.static class
RBBIDataWrapper.RBBIStateTable
A RBBI State Transition table, the form of the data used at run time in Java.
-
Field Summary
Fields Modifier and Type Field Description static int
ACCEPTING
offset to the "accepting" field in a state table row.static int
ACCEPTING_UNCONDITIONAL
value constant for the ACCEPTING field of a state table row.static int
DATA_FORMAT
static int
DH_CATCOUNT
static int
DH_FORMATVERSION
static int
DH_FTABLE
static int
DH_FTABLELEN
static int
DH_LENGTH
static int
DH_MAGIC
static int
DH_RTABLE
static int
DH_RTABLELEN
static int
DH_RULESOURCE
static int
DH_RULESOURCELEN
static int
DH_SIZE
static int
DH_STATUSTABLE
static int
DH_STATUSTABLELEN
static int
DH_TRIE
static int
DH_TRIELEN
RBBIDataWrapper.RBBIStateTable
fFTable
RBBIDataWrapper.RBBIDataHeader
fHeader
static int
FORMAT_VERSION
RBBIDataWrapper.RBBIStateTable
fRTable
java.lang.String
fRuleSource
int[]
fStatusTable
CodePointTrie
fTrie
private static RBBIDataWrapper.IsAcceptable
IS_ACCEPTABLE
static int
LOOKAHEAD
offset to the "lookahead" field in a state table row.static int
NEXTSTATES
offset to the start of the next states array in a state table row.static int
RBBI_8BITS_ROWS
static int
RBBI_BOF_REQUIRED
static int
RBBI_LOOKAHEAD_HARD_BREAK
static int
TAGSIDX
offset to the "tagIndex" field in a state table row.
-
Constructor Summary
Constructors Constructor Description RBBIDataWrapper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
charToString(char n, int width)
void
dump(java.io.PrintStream out)
Debug function to display the break iterator data.private void
dumpCharCategories(java.io.PrintStream out)
private void
dumpRow(java.io.PrintStream out, RBBIDataWrapper.RBBIStateTable table, char state)
Dump (for debug) a single row of an RBBI state tableprivate void
dumpTable(java.io.PrintStream out, RBBIDataWrapper.RBBIStateTable table)
Dump a state table.static boolean
equals(RBBIDataWrapper.RBBIStateTable left, RBBIDataWrapper.RBBIStateTable right)
Equals helper for state tables, including null handling.static RBBIDataWrapper
get(java.nio.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 java.lang.String
intToHexString(int n, int width)
Fixed width int-to-string conversion.static java.lang.String
intToString(int n, int width)
Fixed width int-to-string conversion.
-
-
-
Field Detail
-
fHeader
public RBBIDataWrapper.RBBIDataHeader fHeader
-
fFTable
public RBBIDataWrapper.RBBIStateTable fFTable
-
fRTable
public RBBIDataWrapper.RBBIStateTable fRTable
-
fTrie
public CodePointTrie fTrie
-
fRuleSource
public java.lang.String fRuleSource
-
fStatusTable
public int[] fStatusTable
-
DATA_FORMAT
public static final int DATA_FORMAT
- See Also:
- Constant Field Values
-
FORMAT_VERSION
public static final int FORMAT_VERSION
- See Also:
- Constant Field Values
-
IS_ACCEPTABLE
private static final RBBIDataWrapper.IsAcceptable IS_ACCEPTABLE
-
DH_SIZE
public static final int DH_SIZE
- See Also:
- Constant Field Values
-
DH_MAGIC
public static final int DH_MAGIC
- See Also:
- Constant Field Values
-
DH_FORMATVERSION
public static final int DH_FORMATVERSION
- See Also:
- Constant Field Values
-
DH_LENGTH
public static final int DH_LENGTH
- See Also:
- Constant Field Values
-
DH_CATCOUNT
public static final int DH_CATCOUNT
- See Also:
- Constant Field Values
-
DH_FTABLE
public static final int DH_FTABLE
- See Also:
- Constant Field Values
-
DH_FTABLELEN
public static final int DH_FTABLELEN
- See Also:
- Constant Field Values
-
DH_RTABLE
public static final int DH_RTABLE
- See Also:
- Constant Field Values
-
DH_RTABLELEN
public static final int DH_RTABLELEN
- See Also:
- Constant Field Values
-
DH_TRIE
public static final int DH_TRIE
- See Also:
- Constant Field Values
-
DH_TRIELEN
public static final int DH_TRIELEN
- See Also:
- Constant Field Values
-
DH_RULESOURCE
public static final int DH_RULESOURCE
- See Also:
- Constant Field Values
-
DH_RULESOURCELEN
public static final int DH_RULESOURCELEN
- See Also:
- Constant Field Values
-
DH_STATUSTABLE
public static final int DH_STATUSTABLE
- See Also:
- Constant Field Values
-
DH_STATUSTABLELEN
public static final int DH_STATUSTABLELEN
- See Also:
- Constant Field Values
-
ACCEPTING
public static final int ACCEPTING
offset to the "accepting" field in a state table row.- See Also:
- Constant Field Values
-
LOOKAHEAD
public static final int LOOKAHEAD
offset to the "lookahead" field in a state table row.- See Also:
- Constant Field Values
-
TAGSIDX
public static final int TAGSIDX
offset to the "tagIndex" field in a state table row.- See Also:
- Constant Field Values
-
NEXTSTATES
public static final int NEXTSTATES
offset to the start of the next states array in a state table row.- See Also:
- Constant Field Values
-
ACCEPTING_UNCONDITIONAL
public static final int ACCEPTING_UNCONDITIONAL
value constant for the ACCEPTING field of a state table row.- See Also:
- Constant Field Values
-
RBBI_LOOKAHEAD_HARD_BREAK
public static final int RBBI_LOOKAHEAD_HARD_BREAK
- See Also:
- Constant Field Values
-
RBBI_BOF_REQUIRED
public static final int RBBI_BOF_REQUIRED
- See Also:
- Constant Field Values
-
RBBI_8BITS_ROWS
public static final int RBBI_8BITS_ROWS
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public static RBBIDataWrapper get(java.nio.ByteBuffer bytes) throws java.io.IOException
Get an RBBIDataWrapper from an InputStream onto a pre-compiled set of RBBI rules.- Throws:
java.io.IOException
-
dump
public void dump(java.io.PrintStream out)
Debug function to display the break iterator data.
-
intToString
public static java.lang.String intToString(int n, int width)
Fixed width int-to-string conversion.
-
charToString
public static java.lang.String charToString(char n, int width)
-
intToHexString
public static java.lang.String intToHexString(int n, int width)
Fixed width int-to-string conversion.
-
dumpTable
private void dumpTable(java.io.PrintStream out, RBBIDataWrapper.RBBIStateTable table)
Dump a state table. (A full set of RBBI rules has 4 state tables.)
-
dumpRow
private void dumpRow(java.io.PrintStream out, RBBIDataWrapper.RBBIStateTable table, char state)
Dump (for debug) a single row of an RBBI state table- Parameters:
table
-state
-
-
dumpCharCategories
private void dumpCharCategories(java.io.PrintStream out)
-
-