short [] exportTable() {
           int                state;
           int                col;

           if (fRB.fTreeRoots[fRootIx] == null) {
               return new short[0];
           }

           Assert.assrt(fRB.fSetBuilder.getNumCharCategories() < 0x7fff &&
               fDStates.size() < 0x7fff);

           int numStates = fDStates.size();

           // Size of table size in shorts.
           //  the "4" is the size of struct RBBIStateTableRow, the row header part only.
           int rowLen = 4 + fRB.fSetBuilder.getNumCharCategories();
           int tableSize = getTableSize() / 2;


           short [] table = new short[tableSize];

           //
           // Fill in the header fields.
           //      Annoying because they really want to be ints, not shorts.
           //
           // RBBIStateTable.fNumStates
           table[RBBIDataWrapper.NUMSTATES]   = (short)(numStates >>> 16);
           table[RBBIDataWrapper.NUMSTATES+1] = (short)(numStates & 0x0000ffff);

           // RBBIStateTable.fRowLen
           table[RBBIDataWrapper.ROWLEN]   = (short)(rowLen >>> 16);
           table[RBBIDataWrapper.ROWLEN+1] = (short)(rowLen & 0x0000ffff);

           // RBBIStateTable.fFlags
           int flags = 0;
           if (fRB.fLookAheadHardBreak) {
               flags  |= RBBIDataWrapper.RBBI_LOOKAHEAD_HARD_BREAK;
           }
           if (fRB.fSetBuilder.sawBOF()) {
               flags  |= RBBIDataWrapper.RBBI_BOF_REQUIRED;
           }
           table[RBBIDataWrapper.FLAGS]   = (short)(flags >>> 16);
           table[RBBIDataWrapper.FLAGS+1] = (short)(flags & 0x0000ffff);

           int numCharCategories = fRB.fSetBuilder.getNumCharCategories();
           for (state=0; state<numStates; state++) {
               RBBIStateDescriptor sd = fDStates.get(state);
               int                row = 8 + state*rowLen;
               Assert.assrt (-32768 < sd.fAccepting && sd.fAccepting <= 32767);
               Assert.assrt (-32768 < sd.fLookAhead && sd.fLookAhead <= 32767);
               table[row + RBBIDataWrapper.ACCEPTING] = (short)sd.fAccepting;
               table[row + RBBIDataWrapper.LOOKAHEAD] = (short)sd.fLookAhead;
               table[row + RBBIDataWrapper.TAGIDX]    = (short)sd.fTagsIdx;
               for (col=0; col<numCharCategories; col++) {
                   table[row + RBBIDataWrapper.NEXTSTATES + col] = (short)sd.fDtran[col];
               }
           }
           return table;
       }
short [ ] exportTable ( ) { int state ; int col ; if ( fRB . fTreeRoots [ fRootIx ] == null ) { return new short [ 0 ] ; } Assert . assrt ( fRB . fSetBuilder . getNumCharCategories ( ) < 0x7fff && fDStates . size ( ) < 0x7fff ) ; int numStates = fDStates . size ( ) ; int rowLen = 4 + fRB . fSetBuilder . getNumCharCategories ( ) ; int tableSize = getTableSize ( ) / 2 ; short [ ] table = new short [ tableSize ] ; table [ RBBIDataWrapper . NUMSTATES ] = ( short ) ( numStates > > > 16 ) ; table [ RBBIDataWrapper . NUMSTATES + 1 ] = ( short ) ( numStates & 0x0000ffff ) ; table [ RBBIDataWrapper . ROWLEN ] = ( short ) ( rowLen > > > 16 ) ; table [ RBBIDataWrapper . ROWLEN + 1 ] = ( short ) ( rowLen & 0x0000ffff ) ; int flags = 0 ; if ( fRB . fLookAheadHardBreak ) { flags |= RBBIDataWrapper . RBBI_LOOKAHEAD_HARD_BREAK ; } if ( fRB . fSetBuilder . sawBOF ( ) ) { flags |= RBBIDataWrapper . RBBI_BOF_REQUIRED ; } table [ RBBIDataWrapper . FLAGS ] = ( short ) ( flags > > > 16 ) ; table [ RBBIDataWrapper . FLAGS + 1 ] = ( short ) ( flags & 0x0000ffff ) ; int numCharCategories = fRB . fSetBuilder . getNumCharCategories ( ) ; for ( state = 0 ; state < numStates ; state ++ ) { RBBIStateDescriptor sd = fDStates . get ( state ) ; int row = 8 + state * rowLen ; Assert . assrt ( - 32768 < sd . fAccepting && sd . fAccepting <= 32767 ) ; Assert . assrt ( - 32768 < sd . fLookAhead && sd . fLookAhead <= 32767 ) ; table [ row + RBBIDataWrapper . ACCEPTING ] = ( short ) sd . fAccepting ; table [ row + RBBIDataWrapper . LOOKAHEAD ] = ( short ) sd . fLookAhead ; table [ row + RBBIDataWrapper . TAGIDX ] = ( short ) sd . fTagsIdx ; for ( col = 0 ; col < numCharCategories ; col ++ ) { table [ row + RBBIDataWrapper . NEXTSTATES + col ] = ( short ) sd . fDtran [ col ] ; } } return table ; }
-----------------------------------------------------------------------------