Java Code Examples for org.bson.BsonWriter#writeDouble()
The following examples show how to use
org.bson.BsonWriter#writeDouble() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CenterFilter.java From morphia with Apache License 2.0 | 6 votes |
@Override public void encode(final Mapper mapper, final BsonWriter writer, final EncoderContext context) { writer.writeStartDocument(field(mapper)); writer.writeStartDocument("$geoWithin"); writer.writeStartArray(getFilterName()); Point center = getValue(); writer.writeStartArray(); for (final Double value : center.getPosition().getValues()) { writer.writeDouble(value); } writer.writeEndArray(); writer.writeDouble(radius); writer.writeEndArray(); writer.writeEndDocument(); writer.writeEndDocument(); }
Example 2
Source File: PolygonFilter.java From morphia with Apache License 2.0 | 6 votes |
@Override public void encode(final Mapper mapper, final BsonWriter writer, final EncoderContext context) { writer.writeStartDocument(field(mapper)); writer.writeStartDocument("$geoWithin"); writer.writeStartArray("$polygon"); for (final Point point : points) { writer.writeStartArray(); for (final Double value : point.getPosition().getValues()) { writer.writeDouble(value); } writer.writeEndArray(); } writer.writeEndArray(); writer.writeEndDocument(); writer.writeEndDocument(); }
Example 3
Source File: ShapeCodec.java From morphia with Apache License 2.0 | 5 votes |
private void encodePosition(final BsonWriter writer, final Position value) { writer.writeStartArray(); for (double number : value.getValues()) { writer.writeDouble(number); } writer.writeEndArray(); }
Example 4
Source File: CenterCodec.java From morphia with Apache License 2.0 | 5 votes |
@Override public void encode(final BsonWriter writer, final dev.morphia.query.Shape.Center value, final EncoderContext encoderContext) { writer.writeStartDocument(); writer.writeStartArray(value.getGeometry()); encodePosition(writer, value.getCenter().getPosition()); writer.writeDouble(value.getRadius()); writer.writeEndArray(); writer.writeEndDocument(); }
Example 5
Source File: CenterCodec.java From morphia with Apache License 2.0 | 5 votes |
private void encodePosition(final BsonWriter writer, final Position value) { writer.writeStartArray(); for (double number : value.getValues()) { writer.writeDouble(number); } writer.writeEndArray(); }
Example 6
Source File: AbstractJsonCodec.java From vertx-mongo-client with Apache License 2.0 | 4 votes |
protected void writeDouble(BsonWriter writer, String name, Object value, EncoderContext ctx) { writer.writeDouble((double) value); }