return createInteger(val); boolean allZeros = isAllZeros(mant) && isAllZeros(exp); switch (lastChar) { case 'l' : if (dec == null && exp == null && (numeric.charAt(0) == '-' && isDigits(numeric.substring(1)) || isDigits(numeric))) { try { return createLong(numeric); } catch (NumberFormatException nfe) { return createBigInteger(numeric); case 'F' : try { Float f = NumberUtils.createFloat(numeric); if (!(f.isInfinite() || (f.floatValue() == 0.0F && !allZeros))) { case 'D' : try { Double d = NumberUtils.createDouble(numeric); if (!(d.isInfinite() || (d.floatValue() == 0.0D && !allZeros))) { return d; return createBigDecimal(numeric); } catch (NumberFormatException e) {
/** * <p>Convert a <code>String</code> to an <code>int</code>, returning * <code>zero</code> if the conversion fails.</p> * * @param str the string to convert * @return the int represented by the string, or <code>zero</code> if * conversion fails */ public static int stringToInt(String str) { return stringToInt(str, 0); }
return NumberUtils.isDigits(value) ? Long.parseLong(value) : null; } catch (Exception e) { return null; return NumberUtils.isNumber(value) ? Float.parseFloat(value) : null; } catch (Exception e) { return null; return NumberUtils.isDigits(value) ? Integer.parseInt(value) : null; } catch (Exception e) { return null;
/** * find the number string in a method to call parameter with the following format parameterPrefix.1 or * parameterPrefix.1.bleh * * @param paramPrefix the * @param parameterNames the parameter names. * @return the numerical value or -1 */ public static int getNumbericalValueAfterPrefix(String paramPrefix, Enumeration<String> parameterNames) { for (String parameterName : CollectionUtils.toIterable(parameterNames)) { if (parameterName.startsWith(paramPrefix)) { parameterName = WebUtils.endsWithCoordinates(parameterName) ? parameterName : parameterName + ".x"; String numberStr = StringUtils.substringBetween(parameterName, paramPrefix, "."); if (NumberUtils.isDigits(numberStr)) { return Integer.parseInt(numberStr); } } } return -1; }
return createInteger(val); boolean allZeros = isAllZeros(mant) && isAllZeros(exp); switch (lastChar) { case 'l' : if (dec == null && exp == null && (numeric.charAt(0) == '-' && isDigits(numeric.substring(1)) || isDigits(numeric))) { try { return createLong(numeric); } catch (NumberFormatException nfe) { return createBigInteger(numeric); case 'F' : try { Float f = NumberUtils.createFloat(numeric); if (!(f.isInfinite() || (f.floatValue() == 0.0F && !allZeros))) { case 'D' : try { Double d = NumberUtils.createDouble(numeric); if (!(d.isInfinite() || (d.floatValue() == 0.0D && !allZeros))) { return d; return createBigDecimal(numeric); } catch (NumberFormatException e) {
/** * <p>Convert a <code>String</code> to an <code>int</code>, returning * <code>zero</code> if the conversion fails.</p> * * @param str the string to convert * @return the int represented by the string, or <code>zero</code> if * conversion fails */ public static int stringToInt(String str) { return stringToInt(str, 0); }
return createInteger(val); boolean allZeros = isAllZeros(mant) && isAllZeros(exp); switch (lastChar) { case 'l' : if (dec == null && exp == null && (numeric.charAt(0) == '-' && isDigits(numeric.substring(1)) || isDigits(numeric))) { try { return createLong(numeric); } catch (NumberFormatException nfe) { return createBigInteger(numeric); case 'F' : try { Float f = NumberUtils.createFloat(numeric); if (!(f.isInfinite() || (f.floatValue() == 0.0F && !allZeros))) { case 'D' : try { Double d = NumberUtils.createDouble(numeric); if (!(d.isInfinite() || (d.floatValue() == 0.0D && !allZeros))) { return d; return createBigDecimal(numeric); } catch (NumberFormatException e) {
/** * <p>Convert a <code>String</code> to an <code>int</code>, returning * <code>zero</code> if the conversion fails.</p> * * @param str the string to convert * @return the int represented by the string, or <code>zero</code> if * conversion fails */ public static int stringToInt(String str) { return stringToInt(str, 0); }
return createInteger(val); boolean allZeros = isAllZeros(mant) && isAllZeros(exp); switch (lastChar) { case 'l' : if (dec == null && exp == null && (numeric.charAt(0) == '-' && isDigits(numeric.substring(1)) || isDigits(numeric))) { try { return createLong(numeric); } catch (NumberFormatException nfe) { return createBigInteger(numeric); case 'F' : try { Float f = NumberUtils.createFloat(numeric); if (!(f.isInfinite() || (f.floatValue() == 0.0F && !allZeros))) { case 'D' : try { Double d = NumberUtils.createDouble(numeric); if (!(d.isInfinite() || (d.floatValue() == 0.0D && !allZeros))) { return d; return createBigDecimal(numeric); } catch (NumberFormatException e) {
/** * <p>Convert a <code>String</code> to an <code>int</code>, returning * <code>zero</code> if the conversion fails.</p> * * @param str the string to convert * @return the int represented by the string, or <code>zero</code> if * conversion fails */ public static int stringToInt(String str) { return stringToInt(str, 0); }
return createInteger(val); boolean allZeros = isAllZeros(mant) && isAllZeros(exp); switch (lastChar) { case 'l' : if (dec == null && exp == null && (numeric.charAt(0) == '-' && isDigits(numeric.substring(1)) || isDigits(numeric))) { try { return createLong(numeric); } catch (NumberFormatException nfe) { return createBigInteger(numeric); case 'F' : try { Float f = NumberUtils.createFloat(numeric); if (!(f.isInfinite() || (f.floatValue() == 0.0F && !allZeros))) { case 'D' : try { Double d = NumberUtils.createDouble(numeric); if (!(d.isInfinite() || (d.floatValue() == 0.0D && !allZeros))) { return d; return createBigDecimal(numeric); } catch (NumberFormatException e) {
/** * <p>Convert a <code>String</code> to an <code>int</code>, returning * <code>zero</code> if the conversion fails.</p> * * @param str the string to convert * @return the int represented by the string, or <code>zero</code> if * conversion fails */ public static int stringToInt(String str) { return stringToInt(str, 0); }
return createInteger(val); boolean allZeros = isAllZeros(mant) && isAllZeros(exp); switch (lastChar) { case 'l' : if (dec == null && exp == null && (numeric.charAt(0) == '-' && isDigits(numeric.substring(1)) || isDigits(numeric))) { try { return createLong(numeric); } catch (NumberFormatException nfe) { return createBigInteger(numeric); case 'F' : try { Float f = NumberUtils.createFloat(numeric); if (!(f.isInfinite() || (f.floatValue() == 0.0F && !allZeros))) { case 'D' : try { Double d = NumberUtils.createDouble(numeric); if (!(d.isInfinite() || (d.floatValue() == 0.0D && !allZeros))) { return d; return createBigDecimal(numeric); } catch (NumberFormatException e) {
/** * <p>Convert a <code>String</code> to an <code>int</code>, returning * <code>zero</code> if the conversion fails.</p> * * @param str the string to convert * @return the int represented by the string, or <code>zero</code> if * conversion fails */ public static int stringToInt(String str) { return stringToInt(str, 0); }
static public String wordWrap(String str, String width, String delim, String split) { return wordWrap(str, NumberUtils.stringToInt(width), delim, split); } /**
public void setWidths(String widths) { String[] nums = StringUtils.split(widths, ","); int sz = nums.length; this.widths = new int[sz]; for(int i=0; i<sz; i++) { if("*".equals(nums[i])) { this.widths[i] = 0; } else { this.widths[i] = NumberUtils.stringToInt(nums[i]); } } calcSizeCondition(); }