opennlp.tools.util
Class StringUtil

java.lang.Object
  extended by opennlp.tools.util.StringUtil

public class StringUtil
extends Object


Constructor Summary
StringUtil()
           
 
Method Summary
static boolean isEmpty(CharSequence theString)
          Returns true if CharSequence.length() is 0 or null.
static boolean isWhitespace(char charCode)
          Determines if the specified character is a whitespace.
static boolean isWhitespace(int charCode)
          Determines if the specified character is a whitespace.
static String toLowerCase(CharSequence string)
          Converts to lower case independent of the current locale via Character.toLowerCase(char) which uses mapping information from the UnicodeData file.
static String toUpperCase(CharSequence string)
          Converts to upper case independent of the current locale via Character.toUpperCase(char) which uses mapping information from the UnicodeData file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

isWhitespace

public static boolean isWhitespace(char charCode)
Determines if the specified character is a whitespace. A character is considered a whitespace when one of the following conditions is meet: Character.isWhitespace(int) does not include no-break spaces. In OpenNLP no-break spaces are also considered as white spaces.

Parameters:
charCode -
Returns:
true if white space otherwise false

isWhitespace

public static boolean isWhitespace(int charCode)
Determines if the specified character is a whitespace. A character is considered a whitespace when one of the following conditions is meet: Character.isWhitespace(int) does not include no-break spaces. In OpenNLP no-break spaces are also considered as white spaces.

Parameters:
charCode -
Returns:
true if white space otherwise false

toLowerCase

public static String toLowerCase(CharSequence string)
Converts to lower case independent of the current locale via Character.toLowerCase(char) which uses mapping information from the UnicodeData file.

Parameters:
string -
Returns:
lower cased String

toUpperCase

public static String toUpperCase(CharSequence string)
Converts to upper case independent of the current locale via Character.toUpperCase(char) which uses mapping information from the UnicodeData file.

Parameters:
string -
Returns:
upper cased String

isEmpty

public static boolean isEmpty(CharSequence theString)
Returns true if CharSequence.length() is 0 or null.

Returns:
true if CharSequence.length() is 0, otherwise false
Since:
1.5.1


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.