net.sf.saxon.number

Class Alphanumeric

public class Alphanumeric extends Object

This class contains static utility methods to test whether a character is alphanumeric, as defined by the rules of xsl:number: that is, whether it is in one of the Unicode categories Nd, Nl, No, Lu, Ll, Lt, Lm or Lo
Method Summary
static intgetDigitValue(int in)
Determine whether a character represents a decimal digit and if so, which digit.
static booleanisAlphanumeric(int codepoint)
Determine whether a Unicode codepoint is alphanumeric, that is, whether it is in one of the categories Nd, Nl, No, Lu, Ll, Lt, Lm or Lo

Method Detail

getDigitValue

public static int getDigitValue(int in)
Determine whether a character represents a decimal digit and if so, which digit.

Parameters: in the Unicode character being tested.

Returns: -1 if it's not a decimal digit, otherwise the digit value.

isAlphanumeric

public static boolean isAlphanumeric(int codepoint)
Determine whether a Unicode codepoint is alphanumeric, that is, whether it is in one of the categories Nd, Nl, No, Lu, Ll, Lt, Lm or Lo

Parameters: codepoint the codepoint to be tested

Returns: true if the codepoint is in one of these categories