Lines Matching refs:BreakIterator
24 * {@icuenhanced java.text.BreakIterator}.{@icu _usage_}
28 * of criteria. Instances or subclasses of BreakIterator can be provided, for
32 * We provide five built-in types of BreakIterator:
33 * <ul><li>getTitleInstance() returns a BreakIterator that locates boundaries
35 * <li>getSentenceInstance() returns a BreakIterator that locates boundaries
37 * <li>getWordInstance() returns a BreakIterator that locates boundaries between
39 * This type of BreakIterator makes sure there is a boundary position at the
42 * <li>getLineInstance() returns a BreakIterator that locates positions where it is
48 * <li>getCharacterInstance() returns a BreakIterator that locates boundaries between
62 * BreakIterator's interface follows an "iterator" model (hence the name), meaning it
82 * BreakIterator accesses the text it analyzes through a CharacterIterator, which makes
83 * it possible to use BreakIterator to analyze text in any text-storage vehicle that
86 * <b>Note:</b> Some types of BreakIterator can take a long time to create, and
87 * instances of BreakIterator are not currently cached by the system. For
88 * optimal performance, keep instances of BreakIterator around as long as makes
90 * new BreakIterator for each line. Create one break iterator for the whole document
103 * BreakIterator boundary = BreakIterator.getWordInstance();
107 * boundary = BreakIterator.getSentenceInstance(Locale.US);
120 * public static void printEachForward(BreakIterator boundary, String source) {
123 * end != BreakIterator.DONE;
134 * public static void printEachBackward(BreakIterator boundary, String source) {
137 * start != BreakIterator.DONE;
148 * public static void printFirst(BreakIterator boundary, String source) {
159 * public static void printLast(BreakIterator boundary, String source) {
170 * public static void printAt(BreakIterator boundary, int pos, String source) {
182 * BreakIterator wb = BreakIterator.getWordInstance();
187 * if (wordLimit == BreakIterator.DONE) {
188 * return BreakIterator.DONE;
191 * if (wordStatus != BreakIterator.WORD_NONE) {
213 public abstract class BreakIterator implements Cloneable
216 private static final boolean DEBUG = ICUDebug.enabled("breakiterator");
223 protected BreakIterator()
228 * Clone method. Creates another BreakIterator with the same behavior and
493 * must not be modified in any way while the BreakIterator is still in use.
494 * Doing so will lead to undefined behavior of the BreakIterator.
498 * to the <b>actual iterator being used</b> by the BreakIterator.
515 * this BreakIterator.
530 * the BreakIterator holds a references to it. (As could possibly occur
533 * this BreakIterator.
546 * directly by the BreakIterator, and must not be altered in any
547 * way by code outside of the BreakIterator.
548 * Doing so will lead to undefined behavior of the BreakIterator.
551 * to analyze with this BreakIterator (the iterator's current
591 * Returns a new instance of BreakIterator that locates word boundaries.
594 * @return An instance of BreakIterator that locates word boundaries.
597 public static BreakIterator getWordInstance()
603 * Returns a new instance of BreakIterator that locates word boundaries.
606 * @return An instance of BreakIterator that locates word boundaries.
610 public static BreakIterator getWordInstance(Locale where)
616 * {@icu} Returns a new instance of BreakIterator that locates word boundaries.
619 * @return An instance of BreakIterator that locates word boundaries.
623 public static BreakIterator getWordInstance(ULocale where)
629 * Returns a new instance of BreakIterator that locates legal line-
632 * @return A new instance of BreakIterator that locates legal
636 public static BreakIterator getLineInstance()
642 * Returns a new instance of BreakIterator that locates legal line-
645 * @return A new instance of BreakIterator that locates legal
650 public static BreakIterator getLineInstance(Locale where)
656 * {@icu} Returns a new instance of BreakIterator that locates legal line-
659 * @return A new instance of BreakIterator that locates legal
664 public static BreakIterator getLineInstance(ULocale where)
670 * Returns a new instance of BreakIterator that locates logical-character
673 * @return A new instance of BreakIterator that locates logical-character
677 public static BreakIterator getCharacterInstance()
683 * Returns a new instance of BreakIterator that locates logical-character
686 * @return A new instance of BreakIterator that locates logical-character
691 public static BreakIterator getCharacterInstance(Locale where)
697 * {@icu} Returns a new instance of BreakIterator that locates logical-character
700 * @return A new instance of BreakIterator that locates logical-character
705 public static BreakIterator getCharacterInstance(ULocale where)
711 * Returns a new instance of BreakIterator that locates sentence boundaries.
714 * @return A new instance of BreakIterator that locates sentence boundaries.
717 public static BreakIterator getSentenceInstance()
723 * Returns a new instance of BreakIterator that locates sentence boundaries.
725 * @return A new instance of BreakIterator that locates sentence boundaries.
729 public static BreakIterator getSentenceInstance(Locale where)
735 * {@icu} Returns a new instance of BreakIterator that locates sentence boundaries.
737 * @return A new instance of BreakIterator that locates sentence boundaries.
741 public static BreakIterator getSentenceInstance(ULocale where)
747 * {@icu} Returns a new instance of BreakIterator that locates title boundaries.
752 * @return A new instance of BreakIterator that locates title boundaries.
755 public static BreakIterator getTitleInstance()
761 * {@icu} Returns a new instance of BreakIterator that locates title boundaries.
766 * @return A new instance of BreakIterator that locates title boundaries.
770 public static BreakIterator getTitleInstance(Locale where)
776 * {@icu} Returns a new instance of BreakIterator that locates title boundaries.
781 * @return A new instance of BreakIterator that locates title boundaries.
785 public static BreakIterator getTitleInstance(ULocale where)
795 * <p>Because ICU may choose to cache BreakIterator objects internally, this must
797 * BreakIterator.getInstance to avoid undefined behavior.
799 * @param iter the BreakIterator instance to adopt.
805 public static Object registerInstance(BreakIterator iter, Locale locale, int kind) {
814 * <p>Because ICU may choose to cache BreakIterator objects internally, this must
816 * BreakIterator.getInstance to avoid undefined behavior.
818 * @param iter the BreakIterator instance to adopt.
824 public static Object registerInstance(BreakIterator iter, ULocale locale, int kind) {
839 * {@icu} Unregisters a previously-registered BreakIterator using the key returned
853 // breakiterator before we get to the break iterator tests.
876 * Returns a particular kind of BreakIterator for a locale.
882 public static BreakIterator getBreakInstance(ULocale where, int kind) {
896 BreakIterator result = getShim().createBreakIterator(where, kind);
908 * be used when creating a BreakIterator.
920 * be used when creating a BreakIterator.
932 private BreakIterator iter;
935 BreakIteratorCache(ULocale where, BreakIterator iter) {
937 this.iter = (BreakIterator) iter.clone();
944 BreakIterator createBreakInstance() {
945 return (BreakIterator) iter.clone();
950 public abstract Object registerInstance(BreakIterator iter, ULocale l, int k);
954 public abstract BreakIterator createBreakIterator(ULocale l, int k);