com.eclipsesource.json.JsonObject.getDouble()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(72)

本文整理了Java中com.eclipsesource.json.JsonObject.getDouble()方法的一些代码示例,展示了JsonObject.getDouble()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonObject.getDouble()方法的具体详情如下:
包路径:com.eclipsesource.json.JsonObject
类名称:JsonObject
方法名:getDouble

JsonObject.getDouble介绍

[英]Returns the double value of the member with the specified name in this object. If this object does not contain a member with this name, the given default value is returned. If this object contains multiple members with the given name, the last one will be picked. If this member's value does not represent a JSON number or if it cannot be interpreted as Java double, an exception is thrown.
[中]

代码示例

代码示例来源:origin: ZencashOfficial/zencash-swing-wallet-ui

public void copyFromJSONObject(JsonObject obj)
  throws IOException
{
  // Mandatory fields!
  this.automaticallyAddUsersIfNotExplicitlyImported = 
    obj.getBoolean("automaticallyaddusersifnotexplicitlyimported", true);
  this.amountToSend   = obj.getDouble("amounttosend",   0.0001d);
  this.transactionFee = obj.getDouble("transactionfee", 0.0001d);
}

代码示例来源:origin: BTCPrivate/bitcoin-private-full-node-wallet

public void copyFromJSONObject(JsonObject obj)
    throws IOException
{
  // Mandatory fields!
  this.automaticallyAddUsersIfNotExplicitlyImported =
      obj.getBoolean("automaticallyaddusersifnotexplicitlyimported", true);
  this.amountToSend   = obj.getDouble("amounttosend",   0.0001d);
  this.transactionFee = obj.getDouble("transactionfee", 0.0001d);
}

代码示例来源:origin: BTCPrivate/bitcoin-private-full-node-wallet

if ((respObject.getDouble("code", -1) == -15) &&
    (respObject.getString("message", "ERR").indexOf("unencrypted wallet") != -1)) {
if ((respObject.getDouble("code", -1) == -15) &&
    (respObject.getString("message", "ERR").indexOf("unencrypted wallet") != -1)) {

代码示例来源:origin: ZencashOfficial/zencash-swing-wallet-ui

if ((respObject.getDouble("code", -1) == -15) &&
  (respObject.getString("message", "ERR").indexOf("unencrypted wallet") != -1))
if ((respObject.getDouble("code", -1) == -15) &&
  (respObject.getString("message", "ERR").indexOf("unencrypted wallet") != -1))

代码示例来源:origin: ZencashOfficial/zencash-swing-wallet-ui

if ((respObject.getDouble("code", +123) == -1) &&
   (respObject.getString("message", "ERR").indexOf("wrong network type") != -1))
if ((respObject.getDouble("code", +123) == -1) &&
  (respObject.getString("message", "ERR").indexOf("wrong network type") != -1))

代码示例来源:origin: BTCPrivate/bitcoin-private-full-node-wallet

public synchronized ShieldCoinbaseResponse shieldCoinbase(String from, String to)
    throws WalletCallException, IOException, InterruptedException {
  JsonObject objResponse = this.executeCommandAndGetJsonObject(
      "z_shieldcoinbase", wrapStringParameter(from),
          wrapStringParameter(to));
  ShieldCoinbaseResponse shieldCoinbaseResponse = new ShieldCoinbaseResponse();
  shieldCoinbaseResponse.operationid = objResponse.getString("operationid", null);
  shieldCoinbaseResponse.shieldedUTXOs = objResponse.getInt("shieldedUTXOs", -1);
  if (shieldCoinbaseResponse.shieldedUTXOs == -1) {
    shieldCoinbaseResponse.shieldedUTXOs = objResponse.getInt("shieldingUTXOs", -1);
  }
  shieldCoinbaseResponse.shieldedValue = objResponse.getDouble("shieldedValue", -1);
  if (shieldCoinbaseResponse.shieldedValue == -1) {
    shieldCoinbaseResponse.shieldedValue = objResponse.getDouble("shieldingValue", -1);
  }
  shieldCoinbaseResponse.remainingUTXOs = objResponse.getInt("remainingUTXOs", -1);
  shieldCoinbaseResponse.remainingValue = objResponse.getDouble("remainingValue", -1);
  if (shieldCoinbaseResponse.shieldedValue != -1) {
    return shieldCoinbaseResponse;
  } else {
    throw new WalletCallException("Unexpected z_shieldcoinbase response from wallet: " + objResponse.toString());
  }
}

代码示例来源:origin: BTCPrivate/bitcoin-private-full-node-wallet

JsonArray toManyVerificationArr = Json.parse(toManyArrayStr).asArray();
BigDecimal bdFinalAmount =
    new BigDecimal(toManyVerificationArr.get(0).asObject().getDouble("amount", -1));
BigDecimal difference = bdAmout.subtract(bdFinalAmount).abs();
if (difference.compareTo(new BigDecimal("0.000000015")) >= 0) {

代码示例来源:origin: BTCPrivate/bitcoin-private-full-node-wallet

if ((respObject.getDouble("code", +123) == -1) &&
    (respObject.getString("message", "ERR").indexOf("wrong network type") != -1)) {
if ((respObject.getDouble("code", +123) == -1) &&
    (respObject.getString("message", "ERR").indexOf("wrong network type") != -1)) {

代码示例来源:origin: ZencashOfficial/zencash-swing-wallet-ui

JsonArray toManyVerificationArr = Json.parse(toManyArrayStr).asArray();
BigDecimal bdFinalAmount = 
  new BigDecimal(toManyVerificationArr.get(0).asObject().getDouble("amount", -1));
BigDecimal difference = bdAmout.subtract(bdFinalAmount).abs();
if (difference.compareTo(new BigDecimal("0.000000015")) >= 0)

代码示例来源:origin: com.lordofthejars.diferencia/diferencia-java-core

/**
 * Gets Stats from input stream and closes the stream at the end.
 * @param is where data is present. It is closed at the end.
 * @return Stats object.
 * @throws IOException
 */
public static final Stats fromInputStream(final InputStream is) throws IOException {
  final Stats currentStats = new Stats();
  try (final BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
    final JsonValue parse = Json.parse(reader);
    final JsonArray arrayOfStats = parse.asArray();
    for (JsonValue value : arrayOfStats) {
      final JsonObject stat = value.asObject();
      final JsonObject endpoint = stat.get("endpoint").asObject();
      final String method = endpoint.getString("method", "");
      final String path = endpoint.getString("path", "");
      final int errors = stat.getInt("errors", 0);
      final int success = stat.getInt("success", 0);
      final double averagePrimaryDuration = stat.getDouble("averagePrimaryDuration", 0.0);
      final double averageCandidateDuration = stat.getDouble("averageCandidateDuration", 0.0);
      final List<ErrorDetail> errorDetailList = parseErrorDetails(stat);
      currentStats.stats.add(
        new Stat(method, path, errors, success, averagePrimaryDuration, averageCandidateDuration, errorDetailList)
      );
    }
  }
  return currentStats;
}

相关文章