Lines Matching refs:string

65      * Constructs a new {@code Short} from the specified string.
67 * @param string
68 * the string representation of a short value.
70 * if {@code string} cannot be parsed as a short value.
73 public Short(String string) throws NumberFormatException {
74 this(parseShort(string));
122 * Parses the specified string and returns a {@code Short} instance if the
123 * string can be decoded into a short value. The string may be an optional
127 * @param string
128 * a string representation of a short value.
130 * {@code string}.
132 * if {@code string} cannot be parsed as a short value.
134 public static Short decode(String string) throws NumberFormatException {
135 int intValue = Integer.decode(string).intValue();
140 throw new NumberFormatException("Value out of range for short: \"" + string + "\"");
184 * Parses the specified string as a signed decimal short value. The ASCII
187 * @param string
188 * the string representation of a short value.
189 * @return the primitive short value represented by {@code string}.
191 * if {@code string} cannot be parsed as a short value.
193 public static short parseShort(String string) throws NumberFormatException {
194 return parseShort(string, 10);
198 * Parses the specified string as a signed short value using the specified
201 * @param string
202 * the string representation of a short value.
205 * @return the primitive short value represented by {@code string} using
208 * if {@code string} cannot be parsed as a short value, or
212 public static short parseShort(String string, int radix) throws NumberFormatException {
213 int intValue = Integer.parseInt(string, radix);
218 throw new NumberFormatException("Value out of range for short: \"" + string + "\"");
237 * Returns a string containing a concise, human-readable description of the
241 * the short to convert to a string.
249 * Parses the specified string as a signed decimal short value.
251 * @param string
252 * the string representation of a short value.
254 * by {@code string}.
256 * if {@code string} cannot be parsed as a short value.
259 public static Short valueOf(String string) throws NumberFormatException {
260 return valueOf(parseShort(string));
264 * Parses the specified string as a signed short value using the specified
267 * @param string
268 * the string representation of a short value.
272 * by {@code string} using {@code radix}.
274 * if {@code string} cannot be parsed as a short value, or
279 public static Short valueOf(String string, int radix) throws NumberFormatException {
280 return valueOf(parseShort(string, radix));