| java.lang.Object uk.org.ponder.stringutil.CharParser
CharParser | public class CharParser (Code) | | A useful class which quickly parses numbers from character arrays rather than
from strings as the slovenly Java libraries do.
|
Method Summary | |
public static int | fromHex(char digit) Parses a single hex digit as its integer equivalent. | public static int | parseHexInt(char[] buffer, int start, int length) Parses a positive integer stored as hexadecimal from the contents of a
character array. | public static int | parsePositiveInt(char[] buffer, int start, int length) Parses a positive integer from the contents of a character array. |
fromHex | public static int fromHex(char digit)(Code) | | Parses a single hex digit as its integer equivalent.
The integer corresponding to the supplied hex digit, or -1 if thecharacter is not a valid hex digit. |
parseHexInt | public static int parseHexInt(char[] buffer, int start, int length) throws NumberFormatException(Code) | | Parses a positive integer stored as hexadecimal from the contents of a
character array. The specified section of the array must contain no non-hexadecimal
characters.
Parameters: buffer - The array containing the data to be parsed. Parameters: start - The start position of the numeric data. Parameters: length - The length of the numeric data. exception: NumberFormatException - If the specified array section includesnon-hexadecimal characters or represents an integer out of range for a positivesigned 32-bit integer. |
parsePositiveInt | public static int parsePositiveInt(char[] buffer, int start, int length) throws NumberFormatException(Code) | | Parses a positive integer from the contents of a character array. The
specified section of the array must contain no non-numeric characters.
Parameters: buffer - The array containing the data to be parsed. Parameters: start - The start position of the numeric data. Parameters: length - The length of the numeric data. exception: NumberFormatException - If the specified array section includesnon-numeric characters or represents an integer out of range for a positivesigned 32-bit integer. |
|
|