Lines Matching defs:str

295      * given explicitly by a heuristic to estimate the {@code str}'s directionality.
297 * @param str CharSequence after which the mark may need to appear.
298 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s
305 public String markAfter(CharSequence str, TextDirectionHeuristic heuristic) {
306 final boolean isRtl = heuristic.isRtl(str, 0, str.length());
308 if (!mIsRtlContext && (isRtl || getExitDir(str) == DIR_RTL)) {
311 if (mIsRtlContext && (!isRtl || getExitDir(str) == DIR_LTR)) {
324 * directionality is given explicitly by a heuristic to estimate the {@code str}'s directionality.
326 * @param str CharSequence before which the mark may need to appear.
327 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s
334 public String markBefore(CharSequence str, TextDirectionHeuristic heuristic) {
335 final boolean isRtl = heuristic.isRtl(str, 0, str.length());
337 if (!mIsRtlContext && (isRtl || getEntryDir(str) == DIR_RTL)) {
340 if (mIsRtlContext && (!isRtl || getEntryDir(str) == DIR_LTR)) {
349 * @param str String whose directionality is to be estimated.
350 * @return true if {@code str}'s estimated overall directionality is RTL. Otherwise returns
353 public boolean isRtl(String str) {
354 return isRtl((CharSequence) str);
360 public boolean isRtl(CharSequence str) {
361 return mDefaultTextDirectionHeuristic.isRtl(str, 0, str.length());
370 * the string with Unicode bidi formatting characters: RLE+{@code str}+PDF for RTL text, or
371 * LRE+{@code str}+PDF for LTR text.
386 * @param str The input string.
391 * @return Input string after applying the above processing. {@code null} if {@code str} is
394 public @Nullable String unicodeWrap(@Nullable String str, TextDirectionHeuristic heuristic,
396 if (str == null) return null;
397 return unicodeWrap((CharSequence) str, heuristic, isolate).toString();
403 public @Nullable CharSequence unicodeWrap(@Nullable CharSequence str,
405 if (str == null) return null;
406 final boolean isRtl = heuristic.isRtl(str, 0, str.length());
409 result.append(markBefore(str,
414 result.append(str);
417 result.append(str);
420 result.append(markAfter(str,
430 * @param str The input string.
435 public String unicodeWrap(String str, TextDirectionHeuristic heuristic) {
436 return unicodeWrap(str, heuristic, true /* isolate */);
442 public CharSequence unicodeWrap(CharSequence str, TextDirectionHeuristic heuristic) {
443 return unicodeWrap(str, heuristic, true /* isolate */);
451 * @param str The input string.
456 public String unicodeWrap(String str, boolean isolate) {
457 return unicodeWrap(str, mDefaultTextDirectionHeuristic, isolate);
463 public CharSequence unicodeWrap(CharSequence str, boolean isolate) {
464 return unicodeWrap(str, mDefaultTextDirectionHeuristic, isolate);
471 * @param str The input string.
474 public String unicodeWrap(String str) {
475 return unicodeWrap(str, mDefaultTextDirectionHeuristic, true /* isolate */);
481 public CharSequence unicodeWrap(CharSequence str) {
482 return unicodeWrap(str, mDefaultTextDirectionHeuristic, true /* isolate */);
518 * @param str the string to check.
520 private static int getExitDir(CharSequence str) {
521 return new DirectionalityEstimator(str, false /* isHtml */).getExitDir();
535 * @param str the string to check.
537 private static int getEntryDir(CharSequence str) {
538 return new DirectionalityEstimator(str, false /* isHtml */).getEntryDir();