org.mapdb
Class BTreeKeySerializer.Tuple6KeySerializer<A,B,C,D,E,F>

java.lang.Object
  extended by org.mapdb.BTreeKeySerializer<Fun.Tuple6<A,B,C,D,E,F>>
      extended by org.mapdb.BTreeKeySerializer.Tuple6KeySerializer<A,B,C,D,E,F>
Type Parameters:
A - first tuple value
B - second tuple value
C - 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 Class Summary
 
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>
 
Field Summary
protected  Comparator<A> aComparator
           
protected  Serializer<A> aSerializer
           
protected  Comparator<B> bComparator
           
protected  Serializer<B> bSerializer
           
protected  Comparator<C> cComparator
           
protected  Serializer<C> cSerializer
           
protected  Comparator<D> dComparator
           
protected  Serializer<D> dSerializer
           
protected  Comparator<E> eComparator
           
protected  Serializer<E> eSerializer
           
protected  Serializer<F> fSerializer
           
 
Fields inherited from class org.mapdb.BTreeKeySerializer
BASIC, STRING, TUPLE2, TUPLE3, TUPLE4, ZERO_OR_POSITIVE_INT, ZERO_OR_POSITIVE_LONG
 
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.
 
Methods inherited from class org.mapdb.BTreeKeySerializer
leadingValuePackRead, leadingValuePackWrite
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

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.

Method Detail

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 ata
start - where data start in array. Before this index all keys are null
end - where data ends in array (exclusive). From this index all keys are null
keys - 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 from
start - where data start in array. Before this index all keys are null
end - where data ends in array (exclusive). From this index all keys are null
size - 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.