/** * Writes the start of a JSON sequence representing the interval list. */ @Override protected void onOpen() { getOutput().writeStartSequence(); }
/** * Writes a list of {@code double} values as an array in X, Y, Z order. * @param output The stream to which to write the value. * @param values The values to write. */ public static void writeDoubleList(CesiumOutputStream output, Iterable<Double> values) { output.writeStartSequence(); for (final double value : values) { output.writeValue(value); } output.writeEndSequence(); }
/** * Writes a list of references. * @param output The stream to which to write the value. * @param references The list of references. */ public static void writeReferences(CesiumOutputStream output, Iterable<Reference> references) { output.writeStartSequence(); for (final cesiumlanguagewriter.Reference reference : references) { output.writeValue(reference.getValue()); } output.writeEndSequence(); }
/** * Writes a {@link Rectangular} value as an array in X, Y order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeCartesian2(CesiumOutputStream output, @Nonnull Rectangular value) { output.writeStartSequence(); output.writeValue(value.getX()); output.writeValue(value.getY()); output.writeEndSequence(); }
/** * Writes a {@link Bounds} value as an array in LowerBound, UpperBound order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeBounds(CesiumOutputStream output, @Nonnull Bounds value) { output.writeStartSequence(); output.writeValue(value.getLowerBound()); output.writeValue(value.getUpperBound()); output.writeEndSequence(); }
/** * Writes a {@link UnitSpherical} value as an array in Clock, Cone order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeUnitSpherical(CesiumOutputStream output, @Nonnull UnitSpherical value) { output.writeStartSequence(); output.writeValue(value.getClock()); output.writeValue(value.getCone()); output.writeEndSequence(); }
/** * Writes a {@link Cartesian} value as an array in X, Y, Z order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeCartesian3(CesiumOutputStream output, @Nonnull Cartesian value) { output.writeStartSequence(); output.writeValue(value.getX()); output.writeValue(value.getY()); output.writeValue(value.getZ()); output.writeEndSequence(); }
/** * Writes a {@link Spherical} value as an array in Clock, Cone, Magnitude order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeSpherical(CesiumOutputStream output, @Nonnull Spherical value) { output.writeStartSequence(); output.writeValue(value.getClock()); output.writeValue(value.getCone()); output.writeValue(value.getMagnitude()); output.writeEndSequence(); }
/** * Writes a {@link UnitCartesian} value as an array in X, Y, Z order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeUnitCartesian3(CesiumOutputStream output, @Nonnull UnitCartesian value) { output.writeStartSequence(); output.writeValue(value.getX()); output.writeValue(value.getY()); output.writeValue(value.getZ()); output.writeEndSequence(); }
/** * Writes a {@link Cartographic} value as an array in Longitude, Latitude, Height order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeCartographic(CesiumOutputStream output, @Nonnull Cartographic value) { output.writeStartSequence(); output.writeValue(value.getLongitude()); output.writeValue(value.getLatitude()); output.writeValue(value.getHeight()); output.writeEndSequence(); }
/** * Writes a list of {@link UnitSpherical} values as an array in Clock, Cone order. * @param output The stream to which to write the value. * @param values The values to write. */ public static void writeUnitSphericalList(CesiumOutputStream output, Iterable<UnitSpherical> values) { output.writeStartSequence(); for (final UnitSpherical value : values) { output.writeValue(value.getClock()); output.writeValue(value.getCone()); } output.writeEndSequence(); }
/** * Writes a {@link NearFarScalar} value as an array in NearDistance, NearValue, FarDistance, FarValue order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeNearFarScalar(CesiumOutputStream output, @Nonnull NearFarScalar value) { output.writeStartSequence(); output.writeValue(value.getNearDistance()); output.writeValue(value.getNearValue()); output.writeValue(value.getFarDistance()); output.writeValue(value.getFarValue()); output.writeEndSequence(); }
/** * Writes a {@link UnitQuaternion} as an array in [X, Y, Z, W] order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeUnitQuaternion(CesiumOutputStream output, @Nonnull UnitQuaternion value) { output.writeStartSequence(); output.writeValue(value.getX()); output.writeValue(value.getY()); output.writeValue(value.getZ()); output.writeValue(value.getW()); output.writeEndSequence(); }
/** * Writes a {@link BoundingRectangle} value as an array in X, Y, Width, Height order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeBoundingRectangle(CesiumOutputStream output, @Nonnull BoundingRectangle value) { output.writeStartSequence(); output.writeValue(value.getLeft()); output.writeValue(value.getBottom()); output.writeValue(value.getWidth()); output.writeValue(value.getHeight()); output.writeEndSequence(); }
/** * Writes a list of {@link Cartographic} values as an array in Longitude, Latitude, Height order. * @param output The stream to which to write the value. * @param values The values to write. */ public static void writeCartographicList(CesiumOutputStream output, Iterable<Cartographic> values) { output.writeStartSequence(); for (final Cartographic value : values) { output.writeValue(value.getLongitude()); output.writeValue(value.getLatitude()); output.writeValue(value.getHeight()); } output.writeEndSequence(); }
/** * Writes a list of {@link UnitCartesian} values as an array in X, Y, Z order. * @param output The stream to which to write the value. * @param values The values to write. */ public static void writeUnitCartesian3List(CesiumOutputStream output, Iterable<UnitCartesian> values) { output.writeStartSequence(); for (final UnitCartesian value : values) { output.writeValue(value.getX()); output.writeValue(value.getY()); output.writeValue(value.getZ()); } output.writeEndSequence(); }
/** * Writes a list of {@link Spherical} values as an array in Clock, Cone, Magnitude order. * @param output The stream to which to write the value. * @param values The values to write. */ public static void writeSphericalList(CesiumOutputStream output, Iterable<Spherical> values) { output.writeStartSequence(); for (final Spherical value : values) { output.writeValue(value.getClock()); output.writeValue(value.getCone()); output.writeValue(value.getMagnitude()); } output.writeEndSequence(); }
/** * Writes a {@link CartographicExtent} value as an array in WestLongitude, SouthLatitude, EastLongitude, NorthLatitude order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeCartographicExtent(CesiumOutputStream output, CartographicExtent value) { output.writeStartSequence(); output.writeValue(value.getWestLongitude()); output.writeValue(value.getSouthLatitude()); output.writeValue(value.getEastLongitude()); output.writeValue(value.getNorthLatitude()); output.writeEndSequence(); }
/** * Writes a {@link Motion1} value as an array in X, Y, Z, vX, vY, vZ order. * @param output The stream to which to write the value. * @param value The value to write. */ public static void writeCartesian3Velocity(CesiumOutputStream output, @Nonnull Motion1<Cartesian> value) { output.writeStartSequence(); output.writeValue(value.getValue().getX()); output.writeValue(value.getValue().getY()); output.writeValue(value.getValue().getZ()); output.writeValue(value.getFirstDerivative().getX()); output.writeValue(value.getFirstDerivative().getY()); output.writeValue(value.getFirstDerivative().getZ()); output.writeEndSequence(); }
@Test public final void successiveCallsToNewPacketReturnSameInstance() { m_outputStream.writeStartSequence(); PacketCesiumWriter packet1 = m_writer.openPacket(m_outputStream); packet1.close(); PacketCesiumWriter packet2 = m_writer.openPacket(m_outputStream); packet2.close(); m_outputStream.writeEndSequence(); Assert.assertSame(packet1, packet2); }