org.mapdb
Class BTreeKeySerializer.Tuple4KeySerializer<A,B,C,D>
java.lang.Object
org.mapdb.BTreeKeySerializer<Fun.Tuple4<A,B,C,D>>
org.mapdb.BTreeKeySerializer.Tuple4KeySerializer<A,B,C,D>
- Type Parameters:
A - first tuple valueB - second tuple valueC - third tuple value
- All Implemented Interfaces:
- Serializable
- Enclosing class:
- BTreeKeySerializer<K>
public static class BTreeKeySerializer.Tuple4KeySerializer<A,B,C,D>
- extends BTreeKeySerializer<Fun.Tuple4<A,B,C,D>>
- implements Serializable
Applies delta compression on array of tuple. First, second and third tuple value may be shared between consequential tuples,
so only first occurrence is serialized. An example:
Value Serialized as
----------------------------------
Tuple(1, 2, 1, 1) 1, 2, 1, 1
Tuple(1, 2, 1, 2) 2
Tuple(1, 3, 3, 3) 3, 3, 3
Tuple(1, 3, 4, 4) 4, 4
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from class org.mapdb.BTreeKeySerializer |
BTreeKeySerializer.BasicKeySerializer, BTreeKeySerializer.Tuple2KeySerializer<A,B>, BTreeKeySerializer.Tuple3KeySerializer<A,B,C>, BTreeKeySerializer.Tuple4KeySerializer<A,B,C,D>, BTreeKeySerializer.Tuple5KeySerializer<A,B,C,D,E>, BTreeKeySerializer.Tuple6KeySerializer<A,B,C,D,E,F> |
aComparator
protected final Comparator<A> aComparator
bComparator
protected final Comparator<B> bComparator
cComparator
protected final Comparator<C> cComparator
aSerializer
protected final Serializer<A> aSerializer
bSerializer
protected final Serializer<B> bSerializer
cSerializer
protected final Serializer<C> cSerializer
dSerializer
protected final Serializer<D> dSerializer
BTreeKeySerializer.Tuple4KeySerializer
public BTreeKeySerializer.Tuple4KeySerializer(Comparator<A> aComparator,
Comparator<B> bComparator,
Comparator<C> cComparator,
Serializer<A> aSerializer,
Serializer<B> bSerializer,
Serializer<C> cSerializer,
Serializer<D> dSerializer)
- Construct new Tuple4 Key Serializer. You may pass null for some value,
In that case 'default' value will be used, Comparable comparator and Default Serializer from DB.
- Parameters:
aComparator - comparator used for first tuple valuebComparator - comparator used for second tuple valuecComparator - comparator used for third tuple value*aSerializer - serializer used for first tuple valuebSerializer - serializer used for second tuple valuecSerializer - serializer used for third tuple valuedSerializer - serializer used for fourth tuple value
serialize
public void serialize(DataOutput out,
int start,
int end,
Object[] keys)
throws IOException
- Description copied from class:
BTreeKeySerializer
- Serialize keys from single BTree Node.
- Specified by:
serialize in class BTreeKeySerializer<Fun.Tuple4<A,B,C,D>>
- Parameters:
out - output stream where to put atastart - where data start in array. Before this index all keys are nullend - where data ends in array (exclusive). From this index all keys are nullkeys - array of keys for single BTree Node
- Throws:
IOException
deserialize
public Object[] deserialize(DataInput in,
int start,
int end,
int size)
throws IOException
- Description copied from class:
BTreeKeySerializer
- Deserializes keys for single BTree Node. To
- Specified by:
deserialize in class BTreeKeySerializer<Fun.Tuple4<A,B,C,D>>
- Parameters:
in - input stream to read data fromstart - where data start in array. Before this index all keys are nullend - where data ends in array (exclusive). From this index all keys are nullsize - size of array which should be returned
- Returns:
- array of keys for single BTree Node
- Throws:
IOException
getComparator
public Comparator<Fun.Tuple4<A,B,C,D>> getComparator()
- Description copied from class:
BTreeKeySerializer
- Some key serializers may only work with they own comparators.
For example delta-packing stores increments between numbers and requires ascending order.
So Key Serializer may provide its own comparator.
- Specified by:
getComparator in class BTreeKeySerializer<Fun.Tuple4<A,B,C,D>>
- Returns:
- comparator which must be used with this method. `null` if comparator is not strictly required.
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
Copyright © 2014. All Rights Reserved.