/** * Constructs a new {@code MathContext} with the specified precision and * with the specified rounding mode. If the precision passed is zero, then * this implies that the computations have to be performed exact, the * rounding mode in this case is irrelevant. * * @param precision * the precision for the new {@code MathContext}. * @param roundingMode * the rounding mode for the new {@code MathContext}. * @throws IllegalArgumentException * if {@code precision < 0}. * @throws NullPointerException * if {@code roundingMode} is {@code null}. */ public MathContext(int precision, RoundingMode roundingMode) { this.precision = precision; this.roundingMode = roundingMode; checkValid(); }
/** * Makes checks upon deserialization of a {@code MathContext} instance. * Checks whether {@code precision >= 0} and {@code roundingMode != null} * * @throws StreamCorruptedException * if {@code precision < 0} * @throws StreamCorruptedException * if {@code roundingMode == null} */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); try { checkValid(); } catch (Exception ex) { throw new StreamCorruptedException(ex.getMessage()); } } }
this.roundingMode = RoundingMode.valueOf(s.substring(roundingModeStart)); checkValid();
/** * Constructs a new {@code MathContext} with the specified precision and * with the specified rounding mode. If the precision passed is zero, then * this implies that the computations have to be performed exact, the * rounding mode in this case is irrelevant. * * @param precision * the precision for the new {@code MathContext}. * @param roundingMode * the rounding mode for the new {@code MathContext}. * @throws IllegalArgumentException * if {@code precision < 0}. * @throws NullPointerException * if {@code roundingMode} is {@code null}. */ public MathContext(int precision, RoundingMode roundingMode) { this.precision = precision; this.roundingMode = roundingMode; checkValid(); }
/** * Constructs a new {@code MathContext} with the specified precision and * with the specified rounding mode. If the precision passed is zero, then * this implies that the computations have to be performed exact, the * rounding mode in this case is irrelevant. * * @param precision * the precision for the new {@code MathContext}. * @param roundingMode * the rounding mode for the new {@code MathContext}. * @throws IllegalArgumentException * if {@code precision < 0}. * @throws NullPointerException * if {@code roundingMode} is {@code null}. */ public MathContext(int precision, RoundingMode roundingMode) { this.precision = precision; this.roundingMode = roundingMode; checkValid(); }
/** * Constructs a new {@code MathContext} with the specified precision and * with the specified rounding mode. If the precision passed is zero, then * this implies that the computations have to be performed exact, the * rounding mode in this case is irrelevant. * * @param precision * the precision for the new {@code MathContext}. * @param roundingMode * the rounding mode for the new {@code MathContext}. * @throws IllegalArgumentException * if {@code precision < 0}. * @throws NullPointerException * if {@code roundingMode} is {@code null}. */ public MathContext(int precision, RoundingMode roundingMode) { this.precision = precision; this.roundingMode = roundingMode; checkValid(); }
/** * Constructs a new {@code MathContext} with the specified precision and * with the specified rounding mode. If the precision passed is zero, then * this implies that the computations have to be performed exact, the * rounding mode in this case is irrelevant. * * @param precision * the precision for the new {@code MathContext}. * @param roundingMode * the rounding mode for the new {@code MathContext}. * @throws IllegalArgumentException * if {@code precision < 0}. * @throws NullPointerException * if {@code roundingMode} is {@code null}. */ public MathContext(int precision, RoundingMode roundingMode) { this.precision = precision; this.roundingMode = roundingMode; checkValid(); }
/** * Constructs a new {@code MathContext} with the specified precision and * with the specified rounding mode. If the precision passed is zero, then * this implies that the computations have to be performed exact, the * rounding mode in this case is irrelevant. * * @param precision * the precision for the new {@code MathContext}. * @param roundingMode * the rounding mode for the new {@code MathContext}. * @throws IllegalArgumentException * if {@code precision < 0}. * @throws NullPointerException * if {@code roundingMode} is {@code null}. */ public MathContext(int precision, RoundingMode roundingMode) { this.precision = precision; this.roundingMode = roundingMode; checkValid(); }
/** * Constructs a new {@code MathContext} with the specified precision and * with the specified rounding mode. If the precision passed is zero, then * this implies that the computations have to be performed exact, the * rounding mode in this case is irrelevant. * * @param precision * the precision for the new {@code MathContext}. * @param roundingMode * the rounding mode for the new {@code MathContext}. * @throws IllegalArgumentException * if {@code precision < 0}. * @throws NullPointerException * if {@code roundingMode} is {@code null}. */ public MathContext(int precision, RoundingMode roundingMode) { this.precision = precision; this.roundingMode = roundingMode; checkValid(); }
/** * Constructs a new {@code MathContext} with the specified precision and * with the specified rounding mode. If the precision passed is zero, then * this implies that the computations have to be performed exact, the * rounding mode in this case is irrelevant. * * @param precision * the precision for the new {@code MathContext}. * @param roundingMode * the rounding mode for the new {@code MathContext}. * @throws IllegalArgumentException * if {@code precision < 0}. * @throws NullPointerException * if {@code roundingMode} is {@code null}. */ public MathContext(int precision, RoundingMode roundingMode) { this.precision = precision; this.roundingMode = roundingMode; checkValid(); }
/** * Makes checks upon deserialization of a {@code MathContext} instance. * Checks whether {@code precision >= 0} and {@code roundingMode != null} * * @throws StreamCorruptedException * if {@code precision < 0} * @throws StreamCorruptedException * if {@code roundingMode == null} */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); try { checkValid(); } catch (Exception ex) { throw new StreamCorruptedException(ex.getMessage()); } } }
/** * Makes checks upon deserialization of a {@code MathContext} instance. * Checks whether {@code precision >= 0} and {@code roundingMode != null} * * @throws StreamCorruptedException * if {@code precision < 0} * @throws StreamCorruptedException * if {@code roundingMode == null} */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); try { checkValid(); } catch (Exception ex) { throw new StreamCorruptedException(ex.getMessage()); } } }
/** * Makes checks upon deserialization of a {@code MathContext} instance. * Checks whether {@code precision >= 0} and {@code roundingMode != null} * * @throws StreamCorruptedException * if {@code precision < 0} * @throws StreamCorruptedException * if {@code roundingMode == null} */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); try { checkValid(); } catch (Exception ex) { throw new StreamCorruptedException(ex.getMessage()); } } }
/** * Makes checks upon deserialization of a {@code MathContext} instance. * Checks whether {@code precision >= 0} and {@code roundingMode != null} * * @throws StreamCorruptedException * if {@code precision < 0} * @throws StreamCorruptedException * if {@code roundingMode == null} */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); try { checkValid(); } catch (Exception ex) { throw new StreamCorruptedException(ex.getMessage()); } } }
/** * Makes checks upon deserialization of a {@code MathContext} instance. * Checks whether {@code precision >= 0} and {@code roundingMode != null} * * @throws StreamCorruptedException * if {@code precision < 0} * @throws StreamCorruptedException * if {@code roundingMode == null} */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); try { checkValid(); } catch (Exception ex) { throw new StreamCorruptedException(ex.getMessage()); } } }
/** * Makes checks upon deserialization of a {@code MathContext} instance. * Checks whether {@code precision >= 0} and {@code roundingMode != null} * * @throws StreamCorruptedException * if {@code precision < 0} * @throws StreamCorruptedException * if {@code roundingMode == null} */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); try { checkValid(); } catch (Exception ex) { throw new StreamCorruptedException(ex.getMessage()); } } }
/** * Makes checks upon deserialization of a {@code MathContext} instance. * Checks whether {@code precision >= 0} and {@code roundingMode != null} * * @throws StreamCorruptedException * if {@code precision < 0} * @throws StreamCorruptedException * if {@code roundingMode == null} */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); try { checkValid(); } catch (Exception ex) { throw new StreamCorruptedException(ex.getMessage()); } } }
this.roundingMode = RoundingMode.valueOf(s.substring(roundingModeStart)); checkValid();
this.roundingMode = RoundingMode.valueOf(s.substring(roundingModeStart)); checkValid();
this.roundingMode = RoundingMode.valueOf(s.substring(roundingModeStart)); checkValid();