org.marketcetera.util.misc
Class StringUtils

java.lang.Object
  extended by org.marketcetera.util.misc.StringUtils

public final class StringUtils
extends Object

Utilities for string management.

Since:
0.6.0
Version:
$Id: StringUtils.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Method Summary
static String fromUCP(int ucp)
          Returns a string containing a single character, namely the given Unicode code point.
static String fromUCP(int[] ucps)
          Returns a string containing the characters with the given Unicode code points.
static boolean isValid(int ucp)
          Checks whether the given integer represents a well-defined unicode code point that is also not an ISO control character or within the surrogate areas (high or low).
static int lengthUCP(String s)
          Returns the number of Unicode code points in the given string.
static int[] toUCPArray(String s)
          Returns an array containing the Unicode code points of the given string.
static String toUCPArrayStr(String s)
          Returns a string containing the integer representations, in uppercase hex, of the Unicode code points of the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

lengthUCP

public static int lengthUCP(String s)
Returns the number of Unicode code points in the given string.

Parameters:
s - The string.
Returns:
The number of Unicode code points.

fromUCP

public static String fromUCP(int[] ucps)
Returns a string containing the characters with the given Unicode code points.

Parameters:
ucps - The code points.
Returns:
The string.

fromUCP

public static String fromUCP(int ucp)
Returns a string containing a single character, namely the given Unicode code point.

Parameters:
ucp - The code point.
Returns:
The string.

toUCPArray

public static int[] toUCPArray(String s)
Returns an array containing the Unicode code points of the given string.

Parameters:
s - The string. It may be null, in which case null is returned.
Returns:
The code points.

toUCPArrayStr

public static String toUCPArrayStr(String s)
Returns a string containing the integer representations, in uppercase hex, of the Unicode code points of the given string.

Parameters:
s - The input string. It may be null, in which case null is returned.
Returns:
The resulting string.

isValid

public static boolean isValid(int ucp)
Checks whether the given integer represents a well-defined unicode code point that is also not an ISO control character or within the surrogate areas (high or low).

Parameters:
ucp - The integer (candidate code point).
Returns:
True if so.


Copyright © 2012. All Rights Reserved.