Examples of intValueExact()


Examples of java.math.BigDecimal.intValueExact()

            }

            if (value instanceof BigDecimal) {
                BigDecimal bigDecimal = (BigDecimal) value;
                try {
                    return bigDecimal.intValueExact();

                } catch (ArithmeticException e) {
                    // rowset.10=Data Type Mismatch
                    throw new SQLException(Messages.getString("rowset.10")); //$NON-NLS-1$
                }
View Full Code Here

Examples of java.math.BigDecimal.intValueExact()

                }
            }
            if (value instanceof BigDecimal) {
                BigDecimal bigDecimal = (BigDecimal) value;
                try {
                    return bigDecimal.intValueExact();

                } catch (ArithmeticException e) {
                    // rowset.10=Data Type Mismatch
                    throw new SQLException(Messages.getString("rowset.10")); //$NON-NLS-1$
                }
View Full Code Here

Examples of java.math.BigDecimal.intValueExact()

            }

            if (value instanceof BigDecimal) {
                BigDecimal bigDecimal = (BigDecimal) value;
                try {
                    return bigDecimal.intValueExact();

                } catch (ArithmeticException e) {
                    // rowset.10=Data Type Mismatch
                    throw new SQLException(Messages.getString("rowset.10")); //$NON-NLS-1$
                }
View Full Code Here

Examples of java.math.BigDecimal.intValueExact()

                }
            }
            if (value instanceof BigDecimal) {
                BigDecimal bigDecimal = (BigDecimal) value;
                try {
                    return bigDecimal.intValueExact();

                } catch (ArithmeticException e) {
                    // rowset.10=Data Type Mismatch
                    throw new SQLException(Messages.getString("rowset.10")); //$NON-NLS-1$
                }
View Full Code Here

Examples of java.math.BigDecimal.intValueExact()

      else {
        BigDecimal bigDec = json.getAsBigDecimal();
        // Find out if it is an int type
        try {
          bigDec.toBigIntegerExact();
          try { return bigDec.intValueExact(); }
          catch(ArithmeticException e) {}
          return bigDec.longValue();
        } catch(ArithmeticException e) {}
        // Just return it as a double
        return bigDec.doubleValue();
View Full Code Here

Examples of java.math.BigDecimal.intValueExact()

            }

            if (value instanceof BigDecimal) {
                BigDecimal bigDecimal = (BigDecimal) value;
                try {
                    return bigDecimal.intValueExact();

                } catch (ArithmeticException e) {
                    // rowset.10=Data Type Mismatch
                    throw new SQLException(Messages.getString("rowset.10")); //$NON-NLS-1$
                }
View Full Code Here

Examples of java.math.BigDecimal.intValueExact()

                }
            }
            if (value instanceof BigDecimal) {
                BigDecimal bigDecimal = (BigDecimal) value;
                try {
                    return bigDecimal.intValueExact();

                } catch (ArithmeticException e) {
                    // rowset.10=Data Type Mismatch
                    throw new SQLException(Messages.getString("rowset.10")); //$NON-NLS-1$
                }
View Full Code Here

Examples of java.math.BigDecimal.intValueExact()

        }
        long range = getMaximumValue();
        range++;
        BigDecimal decimal = fraction.multiply(new BigDecimal(range), VALUE_CONTEXT);
        try {
            int value = decimal.intValueExact();
            checkValue(value);
            return value;
        } catch (ArithmeticException ex) {
            throw new IllegalCalendarFieldValueException("The fractional value " + fraction + " of " + getName() +
                    " cannot be converted as it is not in the range 0 (inclusive) to 1 (exclusive)", this);
View Full Code Here

Examples of java.math.BigDecimal.intValueExact()

      return ((Number)param).intValue();
    }
    else if (param instanceof String) {
      try {
        BigDecimal d = new BigDecimal((String)param);
        return d.intValueExact();
      } catch (Exception e) {
        throw new ParseException("Cant parse integer: '"+(String)param+"'");
      }
    }
    throw new ParseException("Not Integer: "+(param != null ? param.getClass() : "null"));
View Full Code Here

Examples of java.math.BigDecimal.intValueExact()

     * @return this DataWord converted to an int.
     * @throws ArithmeticException - if this will not fit in an int.
     */
    public int intValue() {
      BigDecimal tmpValue = new BigDecimal(this.value());
      return tmpValue.intValueExact();
    }
   
    /**
     * Converts this DataWord to a long, checking for lost information.
     * If this DataWord is out of the possible range for a long result
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.