Package com.google.common.geometry
Class S2TaggedShapeCoder
java.lang.Object
com.google.common.geometry.S2TaggedShapeCoder
@GwtIncompatible("S2LaxPolylineShape and S2LaxPolygonShape")
public class S2TaggedShapeCoder
extends Object
implements S2Coder<S2Shape>
An encoder/decoder of tagged
S2Shapes.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for creatingS2TaggedShapeCoderinstances. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IdentityHashMap<Class<? extends S2Shape>, Integer> static final S2TaggedShapeCoderAn instance of aS2TaggedShapeCoderwhich encodes/decodesS2Shapes in the COMPACT encoding format.private static final S2Coder<S2Polygon.Shape> static final S2TaggedShapeCoderAn instance of aS2TaggedShapeCoderwhich encodes/decodesS2Shapes in the FAST encoding format.private static final S2Coder<S2Polygon.Shape> private static final S2Coder<S2Polyline> private static final com.google.common.collect.ImmutableList<Class<? extends S2LaxPolygonShape>> private static final intprivate static final com.google.common.collect.ImmutableList<Class<? extends S2LaxPolylineShape>> private static final intprivate static final com.google.common.collect.ImmutableList<Class<? extends S2Point.Shape>> private static final intprivate static final com.google.common.collect.ImmutableList<Class<? extends S2Polygon.Shape>> private static final intprivate static final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateS2TaggedShapeCoder(IdentityHashMap<Class<? extends S2Shape>, Integer> classToTypeTag, Map<Integer, S2Coder<? extends S2Shape>> typeTagToCoder) -
Method Summary
Modifier and TypeMethodDescriptionstatic S2TaggedShapeCoder.Builderbuilder()Returns a newS2TaggedShapeCoder.Builder.decode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor) voidencode(S2Shape value, OutputStream output) Encodesvaluetooutput.Returns a newS2TaggedShapeCoder.Builderinitialized with the currentS2TaggedShapeCoder.
-
Field Details
-
POLYGON_TYPE_TAG
private static final int POLYGON_TYPE_TAG- See Also:
-
POLYLINE_TYPE_TAG
private static final int POLYLINE_TYPE_TAG- See Also:
-
POINT_TYPE_TAG
private static final int POINT_TYPE_TAG- See Also:
-
LAX_POLYLINE_TYPE_TAG
private static final int LAX_POLYLINE_TYPE_TAG- See Also:
-
LAX_POLYGON_TYPE_TAG
private static final int LAX_POLYGON_TYPE_TAG- See Also:
-
FAST_POLYGON_SHAPE_CODER
-
COMPACT_POLYGON_SHAPE_CODER
-
FAST_POLYLINE_SHAPE_CODER
-
POLYGON_SHAPE_CLASSES
private static final com.google.common.collect.ImmutableList<Class<? extends S2Polygon.Shape>> POLYGON_SHAPE_CLASSES -
POINT_SHAPE_CLASSES
private static final com.google.common.collect.ImmutableList<Class<? extends S2Point.Shape>> POINT_SHAPE_CLASSES -
LAX_POLYLINE_SHAPE_CLASSES
private static final com.google.common.collect.ImmutableList<Class<? extends S2LaxPolylineShape>> LAX_POLYLINE_SHAPE_CLASSES -
LAX_POLYGON_SHAPE_CLASSES
private static final com.google.common.collect.ImmutableList<Class<? extends S2LaxPolygonShape>> LAX_POLYGON_SHAPE_CLASSES -
FAST
An instance of aS2TaggedShapeCoderwhich encodes/decodesS2Shapes in the FAST encoding format. The FAST format is optimized for fast encoding/decoding. -
COMPACT
An instance of aS2TaggedShapeCoderwhich encodes/decodesS2Shapes in the COMPACT encoding format. The COMPACT format is optimized for disk usage and memory footprint. -
classToTypeTag
-
typeTagToCoder
-
-
Constructor Details
-
S2TaggedShapeCoder
-
-
Method Details
-
encode
Description copied from interface:S2CoderEncodesvaluetooutput.- Specified by:
encodein interfaceS2Coder<S2Shape>- Throws:
IOException
-
decode
Description copied from interface:S2CoderDecodes a value of typeS2Coderfromdatastarting atcursor.position.cursor.positionis updated to the position of the first byte indatafollowing the encoded value. -
builder
Returns a newS2TaggedShapeCoder.Builder. -
toBuilder
Returns a newS2TaggedShapeCoder.Builderinitialized with the currentS2TaggedShapeCoder.
-