byte direction = line.getDirection(); if (direction != Bidi.MIXED) {
/** * Return true if the line is all left-to-right text and the base direction * is left-to-right. * * @return true if the line is all left-to-right text and the base direction * is left-to-right. * * @throws IllegalStateException if this call is not preceded by a successful * call to <code>setPara</code> * @stable ICU 3.8 */ public boolean isLeftToRight() { return (getDirection() == LTR && (paraLevel & 1) == 0); }
/** * Return true if the line is all right-to-left text, and the base direction * is right-to-left * * @return true if the line is all right-to-left text, and the base * direction is right-to-left * * @throws IllegalStateException if this call is not preceded by a successful * call to <code>setPara</code> * @stable ICU 3.8 */ public boolean isRightToLeft() { return (getDirection() == RTL && (paraLevel & 1) == 1); }