예제 #1
0
 /* Tests the method public int current() */
 public void TestCurrent() {
   RuleBasedBreakIterator rbbi = new RuleBasedBreakIterator(".;");
   // Tests when "(fText != null) ? fText.getIndex() : BreakIterator.DONE" is true and false
   rbbi.setText((CharacterIterator) null);
   if (rbbi.current() != BreakIterator.DONE) {
     errln(
         "RuleBasedBreakIterator.current() was suppose to return "
             + "BreakIterator.DONE when the object has a fText of null.");
   }
   rbbi.setText("dummy");
   if (rbbi.current() != 0) {
     errln(
         "RuleBasedBreakIterator.current() was suppose to return "
             + "0 when the object has a fText of dummy.");
   }
 }
예제 #2
0
 @Override
 public int current() {
   int current = rules.current();
   return current == BreakIterator.DONE ? BreakIterator.DONE : workingOffset + current;
 }