org.geotoolkit.util
Class Characters

Object
  extended by Static
      extended by Characters

public final class Characters
extends Static

A set of utilities for characters handling.

Since:
2.1
Version:
3.00
Author:
Martin Desruisseaux (IRD, Geomatys)
Module:
utility/geotk-utility (download)    View source code for this class

Method Summary
static boolean isSubScript(char c)
          Determines whether the character is a subscript.
static boolean isSuperScript(char c)
          Determines whether the character is a superscript.
static char toNormalScript(char c)
          Converts the character argument to normal script.
static char toSubScript(char c)
          Converts the character argument to subscript.
static char toSuperScript(char c)
          Converts the character argument to superscript.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isSuperScript

public static boolean isSuperScript(char c)
Determines whether the character is a superscript. Most superscripts have unicode values from \\u2070 to \\u207F inclusive. 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(char c)
Determines whether the character is a subscript. Most subscripts have unicode values from \\u2080 to \\u208E inclusive. 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 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 digit as a superscript, or c if the given character was not a digit.

toSubScript

public static char toSubScript(char c)
Converts the 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 + - = ( ) n

Parameters:
c - The character to convert.
Returns:
The given digit as a subscript, or c if the given character was not a digit.

toNormalScript

public static char toNormalScript(char c)
Converts the character argument to normal script.

Parameters:
c - The character to convert.
Returns:
The given digit as a normal digit, or c if the given character was not a superscript or a subscript.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.