Package com.google.common.geometry
Class S2TaggedShapeCoder
- java.lang.Object
-
- com.google.common.geometry.S2TaggedShapeCoder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classS2TaggedShapeCoder.BuilderA builder for creatingS2TaggedShapeCoderinstances.
-
Field Summary
Fields Modifier and Type Field Description static S2TaggedShapeCoderCOMPACTAn instance of aS2TaggedShapeCoderwhich encodes/decodesS2Shapes in the COMPACT encoding format.static S2TaggedShapeCoderFASTAn instance of aS2TaggedShapeCoderwhich encodes/decodesS2Shapes in the FAST encoding format.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static S2TaggedShapeCoder.Builderbuilder()Returns a newS2TaggedShapeCoder.Builder.S2Shapedecode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)voidencode(S2Shape value, OutputStream output)Encodesvaluetooutput.S2TaggedShapeCoder.BuildertoBuilder()Returns a newS2TaggedShapeCoder.Builderinitialized with the currentS2TaggedShapeCoder.
-
-
-
Field Detail
-
FAST
public static final S2TaggedShapeCoder FAST
An instance of aS2TaggedShapeCoderwhich encodes/decodesS2Shapes in the FAST encoding format. The FAST format is optimized for fast encoding/decoding.
-
COMPACT
public static final S2TaggedShapeCoder COMPACT
An instance of aS2TaggedShapeCoderwhich encodes/decodesS2Shapes in the COMPACT encoding format. The COMPACT format is optimized for disk usage and memory footprint.
-
-
Method Detail
-
encode
public void encode(S2Shape value, OutputStream output) throws IOException
Description copied from interface:S2CoderEncodesvaluetooutput.- Specified by:
encodein interfaceS2Coder<S2Shape>- Throws:
IOException
-
decode
public S2Shape decode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)
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
public static S2TaggedShapeCoder.Builder builder()
Returns a newS2TaggedShapeCoder.Builder.
-
toBuilder
public S2TaggedShapeCoder.Builder toBuilder()
Returns a newS2TaggedShapeCoder.Builderinitialized with the currentS2TaggedShapeCoder.
-
-