public abstract class TraversableSerializer<T extends scala.collection.TraversableOnce<E>,E> extends TypeSerializer<T> implements scala.Cloneable
Constructor and Description |
---|
TraversableSerializer(TypeSerializer<E> elementSerializer) |
Modifier and Type | Method and Description |
---|---|
boolean |
canEqual(Object obj)
Returns true if the given object can be equaled with this object.
|
scala.collection.generic.CanBuildFrom<T,E,T> |
cbf() |
void |
copy(DataInputView source,
DataOutputView target)
Copies exactly one record from the source input view to the target output view.
|
T |
copy(T from)
Creates a deep copy of the given element in a new element.
|
T |
copy(T from,
T reuse)
Creates a copy from the given element.
|
T |
createInstance()
Creates a new instance of the data type.
|
T |
deserialize(DataInputView source)
De-serializes a record from the given source input view.
|
T |
deserialize(T reuse,
DataInputView source)
De-serializes a record from the given source input view into the given reuse record instance if mutable.
|
TraversableSerializer<T,E> |
duplicate()
Creates a deep copy of this serializer if it is necessary, i.e.
|
TypeSerializer<E> |
elementSerializer() |
boolean |
equals(Object obj) |
abstract scala.collection.generic.CanBuildFrom<T,E,T> |
getCbf() |
int |
getLength()
Gets the length of the data type, if it is a fix length data type.
|
int |
hashCode() |
boolean |
isImmutableType()
Gets whether the type is an immutable type.
|
void |
serialize(T coll,
DataOutputView target)
Serializes the given record to the given target output view.
|
public TraversableSerializer(TypeSerializer<E> elementSerializer)
public TypeSerializer<E> elementSerializer()
public TraversableSerializer<T,E> duplicate()
TypeSerializer
duplicate
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
public T createInstance()
TypeSerializer
createInstance
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
public boolean isImmutableType()
TypeSerializer
isImmutableType
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
public int getLength()
TypeSerializer
getLength
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
-1
for variable length data types.public T copy(T from)
TypeSerializer
copy
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
from
- The element reuse be copied.public T copy(T from, T reuse)
TypeSerializer
copy
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
from
- The element to be copied.reuse
- The element to be reused. May or may not be used.public void copy(DataInputView source, DataOutputView target)
TypeSerializer
target.write(source, 8);
.copy
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
source
- The input view from which to read the record.target
- The target output view to which to write the record.public void serialize(T coll, DataOutputView target)
TypeSerializer
serialize
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
coll
- The record to serialize.target
- The output view to write the serialized data to.public T deserialize(DataInputView source)
TypeSerializer
deserialize
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
source
- The input view from which to read the data.public T deserialize(T reuse, DataInputView source)
TypeSerializer
deserialize
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
reuse
- The record instance into which to de-serialize the data.source
- The input view from which to read the data.public boolean equals(Object obj)
equals
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
public int hashCode()
hashCode
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
public boolean canEqual(Object obj)
TypeSerializer
canEqual
in class TypeSerializer<T extends scala.collection.TraversableOnce<E>>
obj
- Object which wants to take part in the equality relationCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.