Package com.google.common.geometry
Class VectorCoder<T>
java.lang.Object
com.google.common.geometry.VectorCoder<T>
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final VectorCoder
<byte[]> An encoder/decoder ofList<byte[]>
.static final VectorCoder
<S2Shape> An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.COMPACT
encoding.static final VectorCoder
<S2Shape> An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.FAST
encoding.(package private) static final VectorCoder
<String> An encoder/decoder ofList<String>
. -
Constructor Summary
ConstructorsConstructorDescriptionVectorCoder
(S2Coder<T> coder) Constructs aVectorCoder
which encodes/decodes elements with the givencoder
. -
Method Summary
Modifier and TypeMethodDescriptiondecode
(PrimitiveArrays.Bytes data, PrimitiveArrays.Cursor cursor) void
encode
(List<T> values, OutputStream output) Encodesvalue
tooutput
.
-
Field Details
-
BYTE_ARRAY
An encoder/decoder ofList<byte[]>
. -
STRING
An encoder/decoder ofList<String>
. -
FAST_SHAPE
An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.FAST
encoding. -
COMPACT_SHAPE
An encoder/decoder ofS2Shape
s, where the shapes use theS2TaggedShapeCoder.COMPACT
encoding. -
coder
-
-
Constructor Details
-
VectorCoder
Constructs aVectorCoder
which encodes/decodes elements with the givencoder
.
-
-
Method Details
-
encode
Description copied from interface:S2Coder
Encodesvalue
tooutput
.- Specified by:
encode
in interfaceS2Coder<T>
- Throws:
IOException
-
decode
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.
-