Class 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.

    • Constructor Detail

      • RBBIDataWrapper

        RBBIDataWrapper()
    • Method Detail

      • 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)