Package org.nineml.coffeegrinder.util
Class CharacterUtils
- java.lang.Object
-
- org.nineml.coffeegrinder.util.CharacterUtils
-
public class CharacterUtils extends java.lang.ObjectUtility methods for dealing with Unicode characters.These methods exist to encapsulate the semantics in a way that can be translated into C#.
-
-
Constructor Summary
Constructors Constructor Description CharacterUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetNthRune(java.lang.String input, int pos)Get the nth code point from a string.static java.util.List<java.lang.Integer>getRunes(java.lang.String input)Return the code points in a string.static booleanisControl(int codepoint)static booleanisWhitespace(int codepoint)static intruneLength(java.lang.String input)Return the length (in code points) of a string.static char[]toChars(int codepoint)
-
-
-
Method Detail
-
runeLength
public static int runeLength(java.lang.String input)
Return the length (in code points) of a string.- Parameters:
input- the string.- Returns:
- the length.
-
getRunes
public static java.util.List<java.lang.Integer> getRunes(java.lang.String input)
Return the code points in a string.- Parameters:
input- the string.- Returns:
- the code points.
-
getNthRune
public static int getNthRune(java.lang.String input, int pos)Get the nth code point from a string.- Parameters:
input- the string.pos- the character position.- Returns:
- the character.
- Throws:
java.lang.IllegalArgumentException- if the position is out of range.
-
toChars
public static char[] toChars(int codepoint)
-
isWhitespace
public static boolean isWhitespace(int codepoint)
-
isControl
public static boolean isControl(int codepoint)
-
-