/** * Parse byte value from text. Byte values are parsed with optional leading sign flag, followed * by any number of digits. * * @param text text to be parsed * @return converted byte value * @throws IllegalArgumentException on parse error */ public static byte parseByte(String text) throws IllegalArgumentException { int value = parseInt(text); if ((value < Byte.MIN_VALUE) || (value > Byte.MAX_VALUE)) { throw new IllegalArgumentException("Value out of range"); } return (byte) value; }
/** * Parse short value from text. Short values are parsed with optional leading sign flag, * followed by any number of digits. * * @param text text to be parsed * @return converted short value * @throws IllegalArgumentException on parse error */ public static short parseShort(String text) throws IllegalArgumentException { int value = parseInt(text); if ((value < Short.MIN_VALUE) || (value > Short.MAX_VALUE)) { throw new IllegalArgumentException("Value out of range"); } return (short) value; }
/** * Parse char value from text as unsigned 16-bit integer. Char values are parsed with optional * leading sign flag, followed by any number of digits. * * @param text text to be parsed * @return converted char value * @throws IllegalArgumentException on parse error */ public static char parseChar(String text) throws IllegalArgumentException { int value = parseInt(text); if ((value < Character.MIN_VALUE) || (value > Character.MAX_VALUE)) { throw new IllegalArgumentException("Value out of range"); } return (char) value; }
int year = parseInt(text);
int year = parseInt(text.substring(0, split));
int year = parseInt(text.substring(0, split));
/** * Parse byte value from text. Byte values are parsed with optional leading * sign flag, followed by any number of digits. * * @param text text to be parsed * * @return converted byte value * * @throws IllegalArgumentException on parse error */ public static byte parseByte(String text) throws IllegalArgumentException { int value = parseInt(text); if ((value < Byte.MIN_VALUE) || (value > Byte.MAX_VALUE)) { throw new IllegalArgumentException("Value out of range"); } return (byte) value; }
/** * Parse short value from text. Short values are parsed with optional * leading sign flag, followed by any number of digits. * * @param text text to be parsed * * @return converted short value * * @throws IllegalArgumentException on parse error */ public static short parseShort(String text) throws IllegalArgumentException { int value = parseInt(text); if ((value < Short.MIN_VALUE) || (value > Short.MAX_VALUE)) { throw new IllegalArgumentException("Value out of range"); } return (short) value; }
/** * Parse byte value from text. Byte values are parsed with optional leading * sign flag, followed by any number of digits. * * @param text text to be parsed * * @return converted byte value * * @throws IllegalArgumentException on parse error */ public static byte parseByte(String text) throws IllegalArgumentException { int value = parseInt(text); if ((value < Byte.MIN_VALUE) || (value > Byte.MAX_VALUE)) { throw new IllegalArgumentException("Value out of range"); } return (byte) value; }
/** * Parse short value from text. Short values are parsed with optional * leading sign flag, followed by any number of digits. * * @param text text to be parsed * * @return converted short value * * @throws IllegalArgumentException on parse error */ public static short parseShort(String text) throws IllegalArgumentException { int value = parseInt(text); if ((value < Short.MIN_VALUE) || (value > Short.MAX_VALUE)) { throw new IllegalArgumentException("Value out of range"); } return (short) value; }
/** * Parse char value from text as unsigned 16-bit integer. Char values are * parsed with optional leading sign flag, followed by any number of * digits. * * @param text text to be parsed * * @return converted char value * * @throws IllegalArgumentException on parse error */ public static char parseChar(String text) throws IllegalArgumentException { int value = parseInt(text); if ((value < Character.MIN_VALUE) || (value > Character.MAX_VALUE)) { throw new IllegalArgumentException("Value out of range"); } return (char) value; }
/** * Parse char value from text as unsigned 16-bit integer. Char values are * parsed with optional leading sign flag, followed by any number of * digits. * * @param text text to be parsed * * @return converted char value * * @throws IllegalArgumentException on parse error */ public static char parseChar(String text) throws IllegalArgumentException { int value = parseInt(text); if ((value < Character.MIN_VALUE) || (value > Character.MAX_VALUE)) { throw new IllegalArgumentException("Value out of range"); } return (char) value; }
int year = parseInt(text);
int year = parseInt(text);
int year = parseInt(text.substring(0, split));
int year = parseInt(text.substring(0, split));
int year = parseInt(text.substring(0, split));
int year = parseInt(text.substring(0, split));