Package com.google.json.serialization

Examples of com.google.json.serialization.JsonValue.asNumber()


      }

      public void visit(JsonObject node) throws JsonException {
        JsonValue valueNode = node.get("value");
        assertNotNull(valueNode);
        long value = valueNode.asNumber().getInteger();
        assertEquals(curr + 1, value);
        curr++;
      }
    });
  }
View Full Code Here


      }

      public void visit(JsonObject node) throws JsonException {
        JsonValue valueNode = node.get("value");
        assertNotNull(valueNode);
        long value = valueNode.asNumber().getInteger();
        assertEquals(curr + 1, value);
        curr++;
      }
    });
  }
View Full Code Here

      public double visit(JsonObject node, List<Double> values)
          throws JsonException {
        JsonValue valueNode = node.get("value");
        assertNotNull(valueNode);
        long value = valueNode.asNumber().getInteger();
        assertEquals(curr + 1, value);
        curr++;
        if (values.size() > 0) {
          double sum = 0;
          for (double childValue : values) {
View Full Code Here

      childTime += value;
    }
    double duration = 0;
    JsonValue durationNode = node.get("duration");
    if (durationNode != JsonValue.NULL) {
      duration = durationNode.asNumber().getDecimal();
    }
    double selfTime = duration - childTime;
    node.put("selfTime", selfTime);
    return duration;
  }
View Full Code Here

        }
        JsonValue isMainResource = data.get("isMainResource");
        JsonValue identifier = data.get("identifier");
        if (isMainResource != null && isMainResource != JsonValue.NULL
            && identifier != null && identifier != JsonValue.NULL) {
          this.mainResourceIdentfier = identifier.asNumber().getInteger();
          this.mainResourceStartTime = topLevelRec.get("time").asNumber().getDecimal();
          // System.out.println("Found: " + data);
          return i;
        }
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.