Package com.google.common.geometry
Class VectorCoder<T>
- java.lang.Object
-
- com.google.common.geometry.VectorCoder<T>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static VectorCoder<byte[]>
BYTE_ARRAY
An encoder/decoder ofList<byte[]>
.private S2Coder<T>
coder
static VectorCoder<S2Shape>
COMPACT_SHAPE
An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.COMPACT
encoding.static VectorCoder<S2Shape>
FAST_SHAPE
An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.FAST
encoding.(package private) static VectorCoder<java.lang.String>
STRING
An encoder/decoder ofList<String>
.
-
Constructor Summary
Constructors Constructor Description VectorCoder(S2Coder<T> coder)
Constructs aVectorCoder
which encodes/decodes elements with the givencoder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<T>
decode(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor)
void
encode(java.util.List<T> values, java.io.OutputStream output)
Encodesvalue
tooutput
.
-
-
-
Field Detail
-
BYTE_ARRAY
static final VectorCoder<byte[]> BYTE_ARRAY
An encoder/decoder ofList<byte[]>
.
-
STRING
static final VectorCoder<java.lang.String> STRING
An encoder/decoder ofList<String>
.
-
FAST_SHAPE
@GwtIncompatible("S2TaggedShapeCoder") public static final VectorCoder<S2Shape> FAST_SHAPE
An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.FAST
encoding.
-
COMPACT_SHAPE
@GwtIncompatible("S2TaggedShapeCoder") public static final VectorCoder<S2Shape> COMPACT_SHAPE
An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.COMPACT
encoding.
-
-
Method Detail
-
encode
public void encode(java.util.List<T> values, java.io.OutputStream output) throws java.io.IOException
Description copied from interface:S2Coder
Encodesvalue
tooutput
.
-
decode
public java.util.List<T> 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.
-
-