@Test public void testGet() throws Exception { System.out.println("get"); PreciseNumber instance; BigDecimal testNumber = new BigDecimal("7456123.89"); instance = new PreciseNumber(testNumber); assertEquals(new BigDecimal("7456123.89").toPlainString(), instance.get().toPlainString()); instance = new PreciseNumber(1, testNumber); assertEquals(new BigDecimal("7456123.9").toPlainString(), instance.get().toPlainString()); instance = new PreciseNumber(testNumber, 9); assertEquals(new BigDecimal("7456123.89").toPlainString(), instance.get().toPlainString()); instance = new PreciseNumber(testNumber, 9, 2); assertEquals(new BigDecimal("7456123.89").toPlainString(), instance.get().toPlainString()); instance = new PreciseNumber(testNumber, 9, 0); assertEquals(new BigDecimal("7456124").toPlainString(), instance.get().toPlainString()); try { new PreciseNumber(testNumber, 6); fail("PreciseNumber did not report exception even though precision constraint was violated"); } catch (OperationException ex) { assertEquals(ErrorCode.DATATYPE_CONSTRAINT_VIOLATION, ex.getErrorCode()); } instance = new PreciseNumber(testNumber, 7, -2); assertEquals(new BigDecimal("7456100").toPlainString(), instance.get().toPlainString()); try { new PreciseNumber(new BigDecimal("9999"), 4, -1); fail("PreciseNumber did not report exception even though precision constraint was violated due to upward approximation"); } catch (OperationException ex) { assertEquals(ErrorCode.DATATYPE_CONSTRAINT_VIOLATION, ex.getErrorCode()); } }
public BigDecimal get() { return this.bigDecimal; }
PreciseNumber { public BigDecimal get() { return this.bigDecimal; } }
PreciseNumber { public BigDecimal get() { return this.bigDecimal; } PreciseNumber(BigDecimal bigDecimal);  PreciseNumber(int scale, BigDecimal bigDecimal);  PreciseNumber(BigDecimal bigDecimal, int precision);  PreciseNumber(BigDecimal bigDecimal, int precision, int scale); }
PreciseNumber { public BigDecimal get() { return this.bigDecimal; } PreciseNumber(BigDecimal bigDecimal);  PreciseNumber(int scale, BigDecimal bigDecimal);  PreciseNumber(BigDecimal bigDecimal, int precision);  PreciseNumber(BigDecimal bigDecimal, int precision, int scale); BigDecimal getBigDecimal(); int getPrecision(); int getScale(); BigDecimal get(); }
PreciseNumber { public BigDecimal get() { return this.bigDecimal; } PreciseNumber(BigDecimal bigDecimal);  PreciseNumber(int scale, BigDecimal bigDecimal);  PreciseNumber(BigDecimal bigDecimal, int precision);  PreciseNumber(BigDecimal bigDecimal, int precision, int scale); BigDecimal getBigDecimal(); int getPrecision(); int getScale(); BigDecimal get();  }