net.sf.json.JSONObject.getDouble()方法的使用及代码示例

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

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

JSONObject.getDouble介绍

暂无

代码示例

代码示例来源:origin: gooddata/GoodData-CL

public double getDouble(String key) {
  return jsonObject.getDouble(key);
}

代码示例来源:origin: mbreese/couchdb4j

public double getDouble(String arg0) {
  return getJSONObject().getDouble(arg0);
}
public int getInt(String arg0) {

代码示例来源:origin: net.sf.mbus4j/mbus4j-core

@Override
public void fromJSON(JSONObject json) {
  super.fromJSON(json);
  setValue((float) json.getDouble("data"));
}

代码示例来源:origin: blogchong/mite8-com

public static List<JSONObject> listSortKolList(List<JSONObject> list) {
  int iDataNum = list.size();
  for (int i = 0; i < iDataNum - 1; i++) {                      //必须进行N-1次的比较
    for (int j = 0 ; j < iDataNum - 1 - i; j++) {   //iDataNum - 1 - i之后的元素已经有序
      JSONObject jsonObjectJ = list.get(j);
      int topicNumJ = jsonObjectJ.getInt("topic_num");
      double kqiJ = jsonObjectJ.getDouble("kqi");
      long timeJ = 0;
      long timeJ1 = 0;
      JSONObject jsonObjectJ1 = list.get(j+1);
      int topicNumJ1 = jsonObjectJ1.getInt("topic_num");
      double kqiJ1 = jsonObjectJ1.getDouble("kqi");
      try {
        timeJ = TransferTime.stringToLong(jsonObjectJ.getString("update_time"), DefineOut.timeFormat)/1000;
        timeJ1 = TransferTime.stringToLong(jsonObjectJ1.getString("update_time"), DefineOut.timeFormat)/1000;
      }catch (Exception e) {}
      if (timeJ < timeJ1 || (timeJ == timeJ1 && topicNumJ < topicNumJ1) || (timeJ == timeJ1 && topicNumJ == topicNumJ1 && kqiJ < kqiJ1)) {   //相邻两数进行比较,若前大后小则进行交换
        list.set(j, jsonObjectJ1);
        list.set(j+1, jsonObjectJ);
      }
    }
  }
  return list;
}

代码示例来源:origin: com.blazemeter/blazemeter-api-client

private JSONObject extractSummary(JSONObject sumserv) {
  JSONObject summary = new JSONObject();
  summary.put("avg", Math.round(sumserv.getDouble("avg") * 100.0) / 100.0);
  summary.put("min", sumserv.getInt("min"));
  summary.put("max", sumserv.getInt("max"));
  summary.put("tp90", sumserv.getInt("tp90"));
  summary.put("errorPercentage", Math.round((sumserv.getDouble("failed") / sumserv.getDouble("hits") * 100) * 100) / 100);
  int hits = sumserv.getInt("hits");
  double last = sumserv.getDouble("last");
  double first = sumserv.getDouble("first");
  summary.put("hits", sumserv.getInt("hits"));
  double diff = ((last - first) == 0) ? 1 : (last - first);
  summary.put("avgthrpt", Math.round(hits / diff * 100.0) / 100.0);
  return summary;
}

代码示例来源:origin: itesla/ipst

public static SecurityRule fromJSON(JSONObject json) {
  return new JsonSecurityRule(
      new RuleId(RuleAttributeSet.valueOf(json.getString("algoType")),
            new SecurityIndexId(json.getString("contingencyId"),
                      SecurityIndexType.fromLabel(json.getString("indexType")))),
      json.getString("workflowId"),
      (float) json.getDouble("quality"),
      json.getInt("treeSize"),
      (float) json.getDouble("criticality"),
      json.getJSONObject("tree")
  );
}

代码示例来源:origin: JiuzhouSec/nightwatch

stockDataMap.put("preCloseprice", recordJSON.getDouble("closeprice")); //前天收盘价
stockDataMap.put("maxRiseValue", recordJSON.getDouble("maxRiseValue"));  //今日涨停价
stockDataMap.put("maxDownValue", recordJSON.getDouble("maxDownValue"));  //今日跌停价

代码示例来源:origin: blogchong/mite8-com

String m_url  = jsonObject.getString("m_url");
double m_score  = jsonObject.getDouble("m_score");
double m_c_score  = jsonObject.getDouble("m_c_score");

代码示例来源:origin: org.geoserver.script/gs-script-core

@Test
public void testJSON() throws Exception {
  Map map = new HashMap();
  map.put("name", "bomb");
  map.put("price", 12.99);
  ByteArrayOutputStream bout = new ByteArrayOutputStream();
  new MapJSONPPIO().encode(map, bout);
  JSON json = JSONSerializer.toJSON(new String(bout.toByteArray()));
  JSONObject obj = (JSONObject) json;
  assertEquals("bomb", obj.getString("name"));
  assertEquals(12.99, obj.getDouble("price"), 0.1);
}

代码示例来源:origin: com.cerner.ccl.comm/j4ccl-ssh

break;
case F8:
  record.setF8(fieldName, json.getDouble(fieldName));
  break;
case I4:

代码示例来源:origin: uber/phabricator-jenkins-plugin

@Test
public void testToHarbormaster() {
  JSONObject json = result.toHarbormaster();
  assertTrue(json.keySet().contains("engine"));
  assertEquals("display-name", json.getString("name"));
  assertEquals("class-name", json.getString("namespace"));
  assertEquals("pass", json.getString("result"));
  assertEquals(1.2, json.getDouble("duration"), 0.01);
  assertFalse(json.keySet().contains("details"));
}

代码示例来源:origin: DataDog/jenkins-datadog-plugin

message = message + DatadogUtilities.durationToString(builddata.getDouble("duration"));

代码示例来源:origin: DataDog/jenkins-datadog-plugin

message = message + DatadogUtilities.durationToString(builddata.getDouble("duration"));

代码示例来源:origin: DataDog/jenkins-datadog-plugin

message = message + DatadogUtilities.durationToString(builddata.getDouble("duration"));

相关文章

微信公众号

最新文章

更多