Class BreakIteratorAdpater

  • All Implemented Interfaces:
    java.lang.Cloneable

    public abstract class BreakIteratorAdpater
    extends java.text.BreakIterator
    An abstract class that allows subclasses to easily create classes that filter out undesired break points returned by a java.text.BreakIterator instance.

    It works by wrapping an existing base BreakIterator that returns a superset of the desired break points. Before any potential break point is returned from the adaptor, the adapter will validate it by calling isBreakValidInternal(int). If that returns true, then the break is returned to the caller. If it returns false, the break will be filtered out. The next valid break in the same direction will then be substituted until an acceptable break is found.

    Author:
    Chris Jennings
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.text.BreakIterator bi  
      protected java.text.CharacterIterator ci  
      • Fields inherited from class java.text.BreakIterator

        DONE
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int current()  
      int first()  
      int following​(int offset)  
      java.text.BreakIterator getBreakIterator()  
      java.text.CharacterIterator getText()  
      protected abstract boolean isBreakValid​(int pos)  
      int last()  
      int next()  
      int next​(int n)  
      int previous()  
      void setBreakIterator​(java.text.BreakIterator wrapee)  
      void setText​(java.text.CharacterIterator newText)  
      • Methods inherited from class java.text.BreakIterator

        clone, getAvailableLocales, getCharacterInstance, getCharacterInstance, getLineInstance, getLineInstance, getSentenceInstance, getSentenceInstance, getWordInstance, getWordInstance, isBoundary, preceding, setText
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • bi

        protected java.text.BreakIterator bi
      • ci

        protected java.text.CharacterIterator ci
    • Constructor Detail

      • BreakIteratorAdpater

        public BreakIteratorAdpater()
      • BreakIteratorAdpater

        public BreakIteratorAdpater​(java.util.Locale loc)
      • BreakIteratorAdpater

        public BreakIteratorAdpater​(java.text.BreakIterator wrapee)
    • Method Detail

      • isBreakValid

        protected abstract boolean isBreakValid​(int pos)
      • current

        public int current()
        Specified by:
        current in class java.text.BreakIterator
      • first

        public int first()
        Specified by:
        first in class java.text.BreakIterator
      • following

        public int following​(int offset)
        Specified by:
        following in class java.text.BreakIterator
      • getText

        public java.text.CharacterIterator getText()
        Specified by:
        getText in class java.text.BreakIterator
      • setText

        public void setText​(java.text.CharacterIterator newText)
        Specified by:
        setText in class java.text.BreakIterator
      • last

        public int last()
        Specified by:
        last in class java.text.BreakIterator
      • next

        public int next()
        Specified by:
        next in class java.text.BreakIterator
      • next

        public int next​(int n)
        Specified by:
        next in class java.text.BreakIterator
      • previous

        public int previous()
        Specified by:
        previous in class java.text.BreakIterator
      • setBreakIterator

        public void setBreakIterator​(java.text.BreakIterator wrapee)
      • getBreakIterator

        public java.text.BreakIterator getBreakIterator()