Examples of DoubleNode


Examples of com.fasterxml.jackson.databind.node.DoubleNode

        continue;
      }
      if (val.startsWith("i ")) {
        field.setValue(new IntNode(Integer.parseInt(val.substring(2))));
      } else if (val.startsWith("d ")) {
        field.setValue(new DoubleNode(Double.parseDouble(val.substring(2))));
      } else if (StringUtils.isBlank(val)) {
        field.setValue(NullNode.getInstance());
      } else {
        field.setValue(new TextNode(val.trim()));
      }
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.DoubleNode

        double step = rand.nextGaussian() * sd.sample().asDouble();
        double newState = state.addAndGet(step);

        if (verbose) {
            ObjectNode r = new ObjectNode(JsonNodeFactory.withExactBigDecimals(false));
            r.set("value", new DoubleNode(newState));
            r.set("step", new DoubleNode(step));
            return r;
        } else {
            return new DoubleNode(newState);
        }
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.DoubleNode

            sd = new FieldSampler() {
                FieldSampler base = FieldSampler.newSampler(value.toString());

                @Override
                public JsonNode sample() {
                    return new DoubleNode(Math.sqrt(1 / base.sample().asDouble()));
                }
            };
        } else {
            this.sd = constant(Math.sqrt(1 / value.asDouble()));
        }
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.DoubleNode

            sd = new FieldSampler() {
                FieldSampler base = FieldSampler.newSampler(value.toString());

                @Override
                public JsonNode sample() {
                    return new DoubleNode(Math.sqrt(base.sample().asDouble()));
                }
            };
        } else {
            this.sd = constant(Math.sqrt(value.asDouble()));
        }
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.DoubleNode

        }
    }

    private FieldSampler constant(final double v) {
        return new FieldSampler() {
            private DoubleNode sd = new DoubleNode(v);

            @Override
            public JsonNode sample() {
                return sd;
            }
View Full Code Here

Examples of com.fasterxml.jackson.databind.node.DoubleNode

    private int seed = SEED_NOT_SET;
    private Gamma rand = new Gamma(alpha, 1 / beta, new Random());

    @Override
    public JsonNode sample() {
        return new DoubleNode(rand.nextDouble());
    }
View Full Code Here

Examples of org.codehaus.jackson.node.DoubleNode

          if (defaultValue != null
              && (Type.FLOAT.equals(fieldSchema.getType())
                  || Type.DOUBLE.equals(fieldSchema.getType()))
              && defaultValue.isTextual())
            defaultValue =
              new DoubleNode(Double.valueOf(defaultValue.getTextValue()));
          Field f = new Field(fieldName, fieldSchema,
                              fieldDoc, defaultValue, order);
          Iterator<String> i = field.getFieldNames();
          while (i.hasNext()) {                       // add field props
            String prop = i.next();
View Full Code Here

Examples of org.codehaus.jackson.node.DoubleNode

          if (defaultValue != null
              && (Type.FLOAT.equals(fieldSchema.getType())
                  || Type.DOUBLE.equals(fieldSchema.getType()))
              && defaultValue.isTextual())
            defaultValue =
              new DoubleNode(Double.valueOf(defaultValue.getTextValue()));
          Field f = new Field(fieldName, fieldSchema,
                              fieldDoc, defaultValue, order);
          Iterator<String> i = field.getFieldNames();
          while (i.hasNext()) {                       // add field props
            String prop = i.next();
View Full Code Here

Examples of org.codehaus.jackson.node.DoubleNode

          if (defaultValue != null
              && (Type.FLOAT.equals(fieldSchema.getType())
                  || Type.DOUBLE.equals(fieldSchema.getType()))
              && defaultValue.isTextual())
            defaultValue =
              new DoubleNode(Double.valueOf(defaultValue.getTextValue()));
          Field f = new Field(fieldName, fieldSchema,
                              fieldDoc, defaultValue, order);
          Iterator<String> i = field.getFieldNames();
          while (i.hasNext()) {                       // add field props
            String prop = i.next();
View Full Code Here

Examples of org.codehaus.jackson.node.DoubleNode

          if (defaultValue != null
              && (Type.FLOAT.equals(fieldSchema.getType())
                  || Type.DOUBLE.equals(fieldSchema.getType()))
              && defaultValue.isTextual())
            defaultValue =
              new DoubleNode(Double.valueOf(defaultValue.getTextValue()));
          Field f = new Field(fieldName, fieldSchema,
                              fieldDoc, defaultValue, order);
          Iterator<String> i = field.getFieldNames();
          while (i.hasNext()) {                       // add field props
            String prop = i.next();
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.