Examples of preceding()


Examples of java.text.BreakIterator.preceding()

        int iteratorPrevWord = bi.preceding(pos);
        while (iteratorPrevWord > 0
                && ((content.charAt(iteratorPrevWord) == ' '
                    || content.charAt(iteratorPrevWord) == '\n')
                    || content.charAt(iteratorPrevWord) == '\t')) {
            iteratorPrevWord = bi.preceding(iteratorPrevWord);
        }
        return iteratorPrevWord == -1 ? 0 : iteratorPrevWord;
    }

    public static final boolean isBidirectional(final Document document) {
View Full Code Here

Examples of java.text.BreakIterator.preceding()

        }
        if (bi.isBoundary(fullIndex)) {
            return Character.isWhitespace(s.array[fullIndex])
                   ? index + 1 : index;
        }
        int prev = bi.preceding(fullIndex);
        if (prev == bi.first()) {
            return index;
        }
        return prev - offset;
    }
View Full Code Here

Examples of java.text.BreakIterator.preceding()

        content = doc.getText(0, doc.getLength());
        bi.setText(content);
        int iteratorWordStart = pos;
        if (pos < length - 1) {
            iteratorWordStart = bi.preceding(pos + 1);
        } else {
             bi.last();
             iteratorWordStart = bi.previous();
        }
        return iteratorWordStart;
View Full Code Here

Examples of java.text.BreakIterator.preceding()

        String content = null;

        content = doc.getText(0, doc.getLength());
        bi.setText(content);

        int iteratorPrevWord = bi.preceding(pos);
        while (iteratorPrevWord > 0
                && ((content.charAt(iteratorPrevWord) == ' '
                    || content.charAt(iteratorPrevWord) == '\n')
                    || content.charAt(iteratorPrevWord) == '\t')) {
            iteratorPrevWord = bi.preceding(iteratorPrevWord);
View Full Code Here

Examples of java.text.BreakIterator.preceding()

        int iteratorPrevWord = bi.preceding(pos);
        while (iteratorPrevWord > 0
                && ((content.charAt(iteratorPrevWord) == ' '
                    || content.charAt(iteratorPrevWord) == '\n')
                    || content.charAt(iteratorPrevWord) == '\t')) {
            iteratorPrevWord = bi.preceding(iteratorPrevWord);
        }
        return iteratorPrevWord == -1 ? 0 : iteratorPrevWord;
    }

    public static final boolean isBidirectional(final Document document) {
View Full Code Here

Examples of java.text.BreakIterator.preceding()

        }
        if (bi.isBoundary(fullIndex)) {
            return Character.isWhitespace(s.array[fullIndex])
                   ? index + 1 : index;
        }
        int prev = bi.preceding(fullIndex);
        if (prev == bi.first()) {
            return index;
        }
        return prev - offset;
    }
View Full Code Here

Examples of java.text.BreakIterator.preceding()

        content = doc.getText(0, doc.getLength());
        bi.setText(content);
        int iteratorWordStart = pos;
        if (pos < length - 1) {
            iteratorWordStart = bi.preceding(pos + 1);
        } else {
             bi.last();
             iteratorWordStart = bi.previous();
        }
        return iteratorWordStart;
View Full Code Here

Examples of java.text.BreakIterator.preceding()

    private String getLine(int index) {
        String result = null;
        BreakIterator bi = BreakIterator.getSentenceInstance();
        bi.setText(getText());
        int end = bi.following(index);
        int start = bi.preceding(end - 1);
        try {
            result = document.getText(start, end - start);
        } catch (BadLocationException e) {
            e.printStackTrace();
        }
View Full Code Here

Examples of java.text.BreakIterator.preceding()

        String content = null;
        content = document.getText(0, length);
        bi.setText(content);
        int iteratorWordStart = pos;
        if (pos < length - 1) {
            iteratorWordStart = bi.preceding(pos + 1);
        } else {
            bi.last();
            iteratorWordStart = bi.previous();
        }
        return iteratorWordStart;
View Full Code Here

Examples of java.text.BreakIterator.preceding()

                    }
                    return (offset < 0) ? null : getWord(offset);
                case AccessibleText.SENTENCE:
                    BreakIterator bi = BreakIterator.getSentenceInstance();
                    bi.setText(getText());
                    offset = bi.preceding(index);
                    offset = bi.previous() + 1;
                    return (offset < 0) ? null : getLine(offset);
                default:
                    return null;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.