/** * Parses an amount expressed in the way humans are used to.<p> * <p/> * This takes string in a format understood by {@link java.math.BigDecimal#BigDecimal(String)}, * for example "0", "1", "0.10", "1.23E3", "1234.5E-5". * * @throws IllegalArgumentException if you try to specify fractional units, or a value out of range. */ public static Value parse(final String currencyCode, final String str) { return Value.parse(FiatType.get(currencyCode), str); } }
public Value getFeeValue() { if (feeProvider != null) { return feeProvider.getFeeValue(this); } else { return getDefaultFeeValue(); } }
public TransactionCreator(TransactionWatcherWallet account) { this.account = account; lock = account.lock; coinType = account.type; minNonDust = coinType.getMinNonDust().toCoin(); softDustLimit = coinType.getSoftDustLimit().toCoin(); }
@Override public String toString() { return toPlainString() + type.getSymbol(); }
@Test(expected = CoinURIParseException.class) public void testAddressRequestBadFormat() throws Exception { new CoinURI(BitcoinTest.get(), BitcoinMain.get().getUriScheme() + ":" + MAINNET_GOOD_ADDRESS + "?req-addressrequest=https%3A%2F%2Fcoinomi.com"); } }
public boolean isDust() { return compareTo(type.getMinNonDust()) < 0; }
@Override public Value oneCoin() { if (oneCoin == null) { BigInteger units = BigInteger.TEN.pow(getUnitExponent()); oneCoin = Value.valueOf(this, units.longValue()); } return oneCoin; }
@Override public Value oneCoin() { if (oneCoin == null) { BigInteger units = BigInteger.TEN.pow(getUnitExponent()); oneCoin = Value.valueOf(this, units.longValue()); } return oneCoin; }
/** * Returns true if and only if this instance represents a monetary value less than zero, * otherwise false. */ public boolean isNegative() { return signum() == -1; }
/** * Returns true if the monetary value represented by this instance is greater than that * of the given other Value, otherwise false. */ public boolean isGreaterThan(Value other) { return compareTo(other) > 0; }
private void setupFeeProvider() { CoinType.setFeeProvider(new CoinType.FeeProvider() { @Override public Value getFeeValue(CoinType type) { return config.getFeeValue(type); } }); }
@Override public int hashCode() { int result = type.hashCode(); result = 31 * result + (int) (accountId ^ (accountId >>> 32)); return result; } }
/** * Returns true if and only if this instance represents zero monetary value, * otherwise false. */ public boolean isZero() { return signum() == 0; }
/** * Returns true if the monetary value represented by this instance is less than that * of the given other Value, otherwise false. */ public boolean isLessThan(Value other) { return compareTo(other) < 0; }
/** * Returns true if and only if this instance represents a monetary value greater than zero, * otherwise false. */ public boolean isPositive() { return signum() == 1; }