public class BidiUtils extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
endsWithLtr(String str)
Like
endsWithLtr(String, boolean) , but assumes str is not
HTML / HTML-escaped. |
boolean |
endsWithLtr(String str,
boolean isHtml)
Check whether the last strongly-directional character in the string is LTR.
|
boolean |
endsWithRtl(String str)
Like
endsWithRtl(String, boolean) , but assumes str is not
HTML / HTML-escaped. |
boolean |
endsWithRtl(String str,
boolean isHtml)
Check whether the last strongly-directional character in the string is RTL.
|
HasDirection.Direction |
estimateDirection(String str)
Like
estimateDirection(String, boolean) , but assumes str
is not HTML / HTML-escaped. |
HasDirection.Direction |
estimateDirection(String str,
boolean isHtml)
Estimates the directionality of a string based on relative word counts.
|
static BidiUtils |
get()
Get an instance of BidiUtils.
|
boolean |
hasAnyLtr(String str)
Like
hasAnyLtr(String, boolean) , but assumes str is not
HTML / HTML-escaped. |
boolean |
hasAnyLtr(String str,
boolean isHtml)
Checks if the given string has any LTR characters in it.
|
boolean |
hasAnyRtl(String str)
Like
hasAnyRtl(String, boolean) , but assumes str is not
HTML / HTML-escaped. |
boolean |
hasAnyRtl(String str,
boolean isHtml)
Checks if the given string has any RTL characters in it.
|
boolean |
startsWithLtr(String str)
Like
startsWithLtr(String, boolean) , but assumes str is
not HTML / HTML-escaped. |
boolean |
startsWithLtr(String str,
boolean isHtml)
Check whether the first strongly-directional character in the string is
LTR.
|
boolean |
startsWithRtl(String str)
Like
startsWithRtl(String, boolean) , but assumes str is
not HTML / HTML-escaped. |
boolean |
startsWithRtl(String str,
boolean isHtml)
Check whether the first strongly-directional character in the string is
RTL.
|
public static BidiUtils get()
public boolean endsWithLtr(String str)
endsWithLtr(String, boolean)
, but assumes str
is not
HTML / HTML-escaped.public boolean endsWithLtr(String str, boolean isHtml)
str
- the string to checkisHtml
- whether str is HTML / HTML-escapedpublic boolean endsWithRtl(String str)
endsWithRtl(String, boolean)
, but assumes str
is not
HTML / HTML-escaped.public boolean endsWithRtl(String str, boolean isHtml)
str
- the string to checkisHtml
- whether str is HTML / HTML-escapedpublic HasDirection.Direction estimateDirection(String str)
estimateDirection(String, boolean)
, but assumes str
is not HTML / HTML-escaped.public HasDirection.Direction estimateDirection(String str, boolean isHtml)
str
- the string to checkisHtml
- whether str
is HTML / HTML-escaped. Use this to
ignore HTML tags and escapes that would otherwise be mistaken for
LTR text.public boolean hasAnyLtr(String str)
hasAnyLtr(String, boolean)
, but assumes str
is not
HTML / HTML-escaped.str
- the string to be testedpublic boolean hasAnyLtr(String str, boolean isHtml)
str
- the string to be testedisHtml
- whether str is HTML / HTML-escapedpublic boolean hasAnyRtl(String str)
hasAnyRtl(String, boolean)
, but assumes str
is not
HTML / HTML-escaped.str
- the string to be testedpublic boolean hasAnyRtl(String str, boolean isHtml)
isHtml
- whether str is HTML / HTML-escapedstr
- the string to be testedpublic boolean startsWithLtr(String str)
startsWithLtr(String, boolean)
, but assumes str
is
not HTML / HTML-escaped.public boolean startsWithLtr(String str, boolean isHtml)
str
- the string to checkisHtml
- whether str is HTML / HTML-escapedpublic boolean startsWithRtl(String str)
startsWithRtl(String, boolean)
, but assumes str
is
not HTML / HTML-escaped.public boolean startsWithRtl(String str, boolean isHtml)
str
- the string to checkisHtml
- whether str
is HTML / HTML-escapedCopyright © 2016. All rights reserved.