Static methods working on
char
values, and some character constants.
Apache SIS uses Unicode symbols directly in the source code for easier reading,
except for some symbols that are difficult to differentiate from other similar
symbols. For those symbols, constants are declared in this class.- Since:
- 0.3
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Subsets of Unicode characters identified by their general category. -
Field Summary
Modifier and TypeFieldDescriptionstatic final char
Hyphen character ('‐', Unicode2010
).static final char
The Unicode line separator (Unicode2028
, HTML<br>
).static final char
The no-break space (Unicode00A0
, HTML
).static final char
The Unicode paragraph separator (Unicode2029
, HTML<p>…</p>
).static final char
Hyphen character to be visible only if there is a line break to insert after it (Unicode00AD
, HTML­
). -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isHexadecimal
(int c) Returnstrue
if the given character is an hexadecimal digit.static boolean
Returnstrue
if the given code point is a line separator, a paragraph separator or one of the'\r'
or'\n'
control characters.static boolean
isSubScript
(int c) Determines whether the given character is a subscript.static boolean
isSuperScript
(int c) Determines whether the given character is a superscript.static boolean
isValidWKT
(int c) Returnstrue
if the given code point is a valid character for Well Known Text (WKT).static char
toNormalScript
(char c) Converts the given character argument to normal script.static int
toNormalScript
(int c) Converts the given code point to normal script.static char
toSubScript
(char c) Converts the given character argument to subscript.static char
toSuperScript
(char c) Converts the given character argument to superscript.
-
Field Details
-
HYPHEN
public static final char HYPHENHyphen character ('‐', Unicode2010
). This code tells toLineAppender
that a line break is allowed to be inserted after this character.For non-breaking hyphen, use the Unicode
2011
character.- See Also:
-
SOFT_HYPHEN
public static final char SOFT_HYPHENHyphen character to be visible only if there is a line break to insert after it (Unicode00AD
, HTML­
). Otherwise this character is invisible. When visible, the graphical symbol is similar to theHYPHEN
character.- See Also:
-
NO_BREAK_SPACE
public static final char NO_BREAK_SPACEThe no-break space (Unicode00A0
, HTML
). Apache SIS uses Unicode symbols directly in the source code for easier reading, except for no-break spaces since they cannot be visually distinguished from the ordinary space (Unicode0020
).- See Also:
-
LINE_SEPARATOR
public static final char LINE_SEPARATORThe Unicode line separator (Unicode2028
, HTML<br>
).- See Also:
-
PARAGRAPH_SEPARATOR
public static final char PARAGRAPH_SEPARATORThe Unicode paragraph separator (Unicode2029
, HTML<p>…</p>
).- See Also:
-
-
Method Details
-
isValidWKT
public static boolean isValidWKT(int c) Returnstrue
if the given code point is a valid character for Well Known Text (WKT). This method returnstrue
for the following characters:
They are ASCII codes 32 to 125 inclusive except ! (33), # (35), $ (36), @ (64) and ` (96), plus the addition of ° (176) despite being formally outside the ASCII character set.A-Z a-z 0-9 _ [ ] ( ) { } < = > . , : ; + - (space) % & ' " * ^ / \ ? | °
- Parameters:
c
- the code point to test.- Returns:
true
if the given code point is a valid WKT character.- Since:
- 0.6
- See Also:
-
isLineOrParagraphSeparator
public static boolean isLineOrParagraphSeparator(int c) Returnstrue
if the given code point is a line separator, a paragraph separator or one of the'\r'
or'\n'
control characters.- Parameters:
c
- the code point to test.- Returns:
true
if the given code point is a line or paragraph separator.- See Also:
-
isHexadecimal
public static boolean isHexadecimal(int c) Returnstrue
if the given character is an hexadecimal digit. This method returnstrue
ifc
is between'0'
and'9'
inclusive, or between'A'
and'F'
inclusive, or between'a'
and'f'
inclusive.- Parameters:
c
- the character to test.- Returns:
true
if the given character is an hexadecimal digit.- Since:
- 0.5
-
isSuperScript
public static boolean isSuperScript(int c) Determines whether the given character is a superscript. Most (but not all) superscripts have a Unicode value in the [2070 … 207F] range. Superscripts are the following symbols:⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁺ ⁻ ⁼ ⁽ ⁾ ⁿ
- Parameters:
c
- the character to test.- Returns:
true
if the given character is a superscript.
-
isSubScript
public static boolean isSubScript(int c) Determines whether the given character is a subscript. All subscripts have a Unicode value in the [2080 … 208E]. Subscripts are the following symbols:₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ ₊ ₋ ₌ ₍ ₎
- Parameters:
c
- the character to test.- Returns:
true
if the given character is a subscript.
-
toSuperScript
public static char toSuperScript(char c) Converts the given character argument to superscript. Only the following characters can be converted (other characters are left unchanged):0 1 2 3 4 5 6 7 8 9 + - = ( ) n
- Parameters:
c
- the character to convert.- Returns:
- the given character as a superscript, or
c
if the given character cannot be converted.
-
toSubScript
public static char toSubScript(char c) Converts the given character argument to subscript. Only the following characters can be converted (other characters are left unchanged):0 1 2 3 4 5 6 7 8 9 + - = ( )
- Parameters:
c
- the character to convert.- Returns:
- the given character as a subscript, or
c
if the given character cannot be converted.
-
toNormalScript
public static char toNormalScript(char c) Converts the given character argument to normal script.- Parameters:
c
- the character to convert.- Returns:
- the given character as a normal script, or
c
if the given character was not a superscript or a subscript.
-
toNormalScript
public static int toNormalScript(int c) Converts the given code point to normal script.- Parameters:
c
- the character to convert.- Returns:
- the given character as a normal script, or
c
if the given character was not a superscript or a subscript. - Since:
- 1.0
-