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 class
S2TaggedShapeCoder.Builder
A builder for creatingS2TaggedShapeCoder
instances.
-
Field Summary
Fields Modifier and Type Field Description private java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer>
classToTypeTag
static S2TaggedShapeCoder
COMPACT
An instance of aS2TaggedShapeCoder
which encodes/decodesS2Shape
s in the COMPACT encoding format.private static S2Coder<S2Polygon.Shape>
COMPACT_POLYGON_SHAPE_CODER
static S2TaggedShapeCoder
FAST
An instance of aS2TaggedShapeCoder
which encodes/decodesS2Shape
s in the FAST encoding format.private static S2Coder<S2Polygon.Shape>
FAST_POLYGON_SHAPE_CODER
private static S2Coder<S2Polyline>
FAST_POLYLINE_SHAPE_CODER
private static com.google.common.collect.ImmutableList<java.lang.Class<? extends S2LaxPolygonShape>>
LAX_POLYGON_SHAPE_CLASSES
private static int
LAX_POLYGON_TYPE_TAG
private static com.google.common.collect.ImmutableList<java.lang.Class<? extends S2LaxPolylineShape>>
LAX_POLYLINE_SHAPE_CLASSES
private static int
LAX_POLYLINE_TYPE_TAG
private static com.google.common.collect.ImmutableList<java.lang.Class<? extends S2Point.Shape>>
POINT_SHAPE_CLASSES
private static int
POINT_TYPE_TAG
private static com.google.common.collect.ImmutableList<java.lang.Class<? extends S2Polygon.Shape>>
POLYGON_SHAPE_CLASSES
private static int
POLYGON_TYPE_TAG
private static int
POLYLINE_TYPE_TAG
private java.util.Map<java.lang.Integer,S2Coder<? extends S2Shape>>
typeTagToCoder
-
Constructor Summary
Constructors Modifier Constructor Description private
S2TaggedShapeCoder(java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer> classToTypeTag, java.util.Map<java.lang.Integer,S2Coder<? extends S2Shape>> typeTagToCoder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static S2TaggedShapeCoder.Builder
builder()
Returns a newS2TaggedShapeCoder.Builder
.S2Shape
decode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)
void
encode(S2Shape value, java.io.OutputStream output)
Encodesvalue
tooutput
.S2TaggedShapeCoder.Builder
toBuilder()
Returns a newS2TaggedShapeCoder.Builder
initialized with the currentS2TaggedShapeCoder
.
-
-
-
Field Detail
-
POLYGON_TYPE_TAG
private static final int POLYGON_TYPE_TAG
- See Also:
- Constant Field Values
-
POLYLINE_TYPE_TAG
private static final int POLYLINE_TYPE_TAG
- See Also:
- Constant Field Values
-
POINT_TYPE_TAG
private static final int POINT_TYPE_TAG
- See Also:
- Constant Field Values
-
LAX_POLYLINE_TYPE_TAG
private static final int LAX_POLYLINE_TYPE_TAG
- See Also:
- Constant Field Values
-
LAX_POLYGON_TYPE_TAG
private static final int LAX_POLYGON_TYPE_TAG
- See Also:
- Constant Field Values
-
FAST_POLYGON_SHAPE_CODER
private static final S2Coder<S2Polygon.Shape> FAST_POLYGON_SHAPE_CODER
-
COMPACT_POLYGON_SHAPE_CODER
private static final S2Coder<S2Polygon.Shape> COMPACT_POLYGON_SHAPE_CODER
-
FAST_POLYLINE_SHAPE_CODER
private static final S2Coder<S2Polyline> FAST_POLYLINE_SHAPE_CODER
-
POLYGON_SHAPE_CLASSES
private static final com.google.common.collect.ImmutableList<java.lang.Class<? extends S2Polygon.Shape>> POLYGON_SHAPE_CLASSES
-
POINT_SHAPE_CLASSES
private static final com.google.common.collect.ImmutableList<java.lang.Class<? extends S2Point.Shape>> POINT_SHAPE_CLASSES
-
LAX_POLYLINE_SHAPE_CLASSES
private static final com.google.common.collect.ImmutableList<java.lang.Class<? extends S2LaxPolylineShape>> LAX_POLYLINE_SHAPE_CLASSES
-
LAX_POLYGON_SHAPE_CLASSES
private static final com.google.common.collect.ImmutableList<java.lang.Class<? extends S2LaxPolygonShape>> LAX_POLYGON_SHAPE_CLASSES
-
FAST
public static final S2TaggedShapeCoder FAST
An instance of aS2TaggedShapeCoder
which encodes/decodesS2Shape
s in the FAST encoding format. The FAST format is optimized for fast encoding/decoding.
-
COMPACT
public static final S2TaggedShapeCoder COMPACT
An instance of aS2TaggedShapeCoder
which encodes/decodesS2Shape
s in the COMPACT encoding format. The COMPACT format is optimized for disk usage and memory footprint.
-
classToTypeTag
private final java.util.IdentityHashMap<java.lang.Class<? extends S2Shape>,java.lang.Integer> classToTypeTag
-
-
Method Detail
-
encode
public void encode(S2Shape value, java.io.OutputStream output) throws java.io.IOException
Description copied from interface:S2Coder
Encodesvalue
tooutput
.
-
decode
public S2Shape decode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)
Description copied from interface:S2Coder
Decodes a value of typeS2Coder
fromdata
starting atcursor.position
.cursor.position
is updated to the position of the first byte indata
following the encoded value.
-
builder
public static S2TaggedShapeCoder.Builder builder()
Returns a newS2TaggedShapeCoder.Builder
.
-
toBuilder
public S2TaggedShapeCoder.Builder toBuilder()
Returns a newS2TaggedShapeCoder.Builder
initialized with the currentS2TaggedShapeCoder
.
-
-