org.mapdb
Class BTreeKeySerializer.Tuple6KeySerializer<A,B,C,D,E,F>
java.lang.Object
org.mapdb.BTreeKeySerializer<Fun.Tuple6<A,B,C,D,E,F>>
org.mapdb.BTreeKeySerializer.Tuple6KeySerializer<A,B,C,D,E,F>
- Type Parameters:
A - first tuple valueB - second tuple valueC - third tuple value
- All Implemented Interfaces:
- Serializable
- Enclosing class:
- BTreeKeySerializer<K>
public static class BTreeKeySerializer.Tuple6KeySerializer<A,B,C,D,E,F>
- extends BTreeKeySerializer<Fun.Tuple6<A,B,C,D,E,F>>
- 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> |
|
Constructor Summary |
BTreeKeySerializer.Tuple6KeySerializer(Comparator<A> aComparator,
Comparator<B> bComparator,
Comparator<C> cComparator,
Comparator<D> dComparator,
Comparator<E> eComparator,
Serializer<A> aSerializer,
Serializer<B> bSerializer,
Serializer<C> cSerializer,
Serializer<D> dSerializer,
Serializer<E> eSerializer,
Serializer<F> fSerializer)
Construct new Tuple4 Key Serializer. |
|
Method Summary |
Object[] |
deserialize(DataInput in,
int start,
int end,
int size)
Deserializes keys for single BTree Node. |
boolean |
equals(Object o)
|
Comparator<Fun.Tuple6<A,B,C,D,E,F>> |
getComparator()
Some key serializers may only work with they own comparators. |
int |
hashCode()
|
void |
serialize(DataOutput out,
int start,
int end,
Object[] keys)
Serialize keys from single BTree Node. |
aComparator
protected final Comparator<A> aComparator
bComparator
protected final Comparator<B> bComparator
cComparator
protected final Comparator<C> cComparator
dComparator
protected final Comparator<D> dComparator
eComparator
protected final Comparator<E> eComparator
aSerializer
protected final Serializer<A> aSerializer
bSerializer
protected final Serializer<B> bSerializer
cSerializer
protected final Serializer<C> cSerializer
dSerializer
protected final Serializer<D> dSerializer
eSerializer
protected final Serializer<E> eSerializer
fSerializer
protected final Serializer<F> fSerializer
BTreeKeySerializer.Tuple6KeySerializer
public BTreeKeySerializer.Tuple6KeySerializer(Comparator<A> aComparator,
Comparator<B> bComparator,
Comparator<C> cComparator,
Comparator<D> dComparator,
Comparator<E> eComparator,
Serializer<A> aSerializer,
Serializer<B> bSerializer,
Serializer<C> cSerializer,
Serializer<D> dSerializer,
Serializer<E> eSerializer,
Serializer<F> fSerializer)
- 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.
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.Tuple6<A,B,C,D,E,F>>
- 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.Tuple6<A,B,C,D,E,F>>
- 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.Tuple6<A,B,C,D,E,F>> 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.Tuple6<A,B,C,D,E,F>>
- 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.