public static DoubleNode valueOf(double v) { return new DoubleNode(v); }
/** * Sets the expected value for this condition. * * @param expectedValue Expected value. * @return This object for method chaining. */ public Builder expectedValue(double expectedValue) { this.expectedValue = new DoubleNode(expectedValue); return this; }
/** * Sets the expected value for this condition. * * @param expectedValue Expected value. * @return This object for method chaining. */ public Builder expectedValue(double expectedValue) { this.expectedValue = new DoubleNode(expectedValue); return this; }
/** * Sets the expected value for this condition. * * @param expectedValue Expected value. * @return This object for method chaining. */ public Builder expectedValue(double expectedValue) { this.expectedValue = new DoubleNode(expectedValue); return this; }
/** * Sets the expected value for this condition. * * @param expectedValue Expected value. * @return This object for method chaining. */ public Builder expectedValue(double expectedValue) { this.expectedValue = new DoubleNode(expectedValue); return this; }
/** * Sets the expected value for this condition. * * @param expectedValue Expected value. * @return This object for method chaining. */ public Builder expectedValue(double expectedValue) { this.expectedValue = new DoubleNode(expectedValue); return this; }
&& defaultValue.isTextual()) defaultValue = new DoubleNode(Double.valueOf(defaultValue.textValue())); Field f = new Field(fieldName, fieldSchema, fieldDoc, defaultValue, order);
return new LongNode(in.readLong()); case DOUBLE: return new DoubleNode(in.readDouble()); case STRING: return new TextNode(in.readString());
case FLOATING_POINT_LITERAL: t = jj_consume_token(FLOATING_POINT_LITERAL); n=new DoubleNode(Double.parseDouble(t.image)); break; case LBRACE:
public void incrementProperty(Connection conn, String project, Object userId, String property, double value) throws SQLException { Map<String, FieldType> columns = createMissingColumns(project, userId, ImmutableList.of(new SimpleImmutableEntry<>(property, new DoubleNode(value))), new CommitConnection(conn)); FieldType fieldType = columns.get(property); if (fieldType == null) { createColumn(project, userId, property, JsonHelper.numberNode(0)); } if (!fieldType.isNumeric()) { throw new RakamException(String.format("The property the is %s and it can't be incremented.", fieldType.name()), BAD_REQUEST); } String tableRef = checkTableColumn(stripName(property, "table column")); Statement statement = conn.createStatement(); ProjectCollection userTable = getUserTable(project, false); String table = checkProject(userTable.project, '"') + "." + checkCollection(userTable.collection); int execute = statement.executeUpdate("update " + table + " set " + tableRef + " = " + value + " + coalesce(" + tableRef + ", 0)"); if (execute == 0) { create(project, userId, JsonHelper.jsonObject().put(property, value)); } }
return new IntNode((Integer) object); } else if (object instanceof Double) { return new DoubleNode((Double) object); } else if (object instanceof Float) { return new FloatNode((Float) object);
public JsonNode convert(Object node) { if (node == null) return NullNode.instance; else return new DoubleNode((Double) node); } }
/** * Sets the expected value for this condition. * * @param expectedValue Expected value. * @return This object for method chaining. */ public Builder expectedValue(double expectedValue) { this.expectedValue = new DoubleNode(expectedValue); return this; }
@Override public List<JsonNode> apply(Scope scope, List<JsonQuery> args, JsonNode in) throws JsonQueryException { return Collections.<JsonNode> singletonList(new DoubleNode(Math.random())); } }
@Override public JsonNode sample() { return new DoubleNode(Math.sqrt(1 / base.sample().asDouble())); } };
@Override public JsonNode sample() { return new DoubleNode(Math.sqrt(base.sample().asDouble())); } };
private JsonNode createNode(Object value) { if (value instanceof Float) { return new FloatNode((Float) value); } else if (value instanceof Double) { return new DoubleNode((Double) value); } return null; } }
@Override public JsonNode sample() { double x; do { x = rand.nextDouble(); } while (x < min || x > max); return new DoubleNode(x); } }
@Override public JsonNode sample() { return new DoubleNode(base.sample().asDouble()); } };
@Override public Object parseLiteral(Object input) { if (input instanceof IntValue) { return new DoubleNode(((IntValue) input).getValue().doubleValue()); } if (input instanceof FloatValue) { return new DoubleNode(((FloatValue) input).getValue().doubleValue()); } else { throw new CoercingParseLiteralException(errorMessage(input, IntValue.class, FloatValue.class)); } } });