org.apache.cassandra.db.marshal
Class MapType<K,V>
java.lang.Object
org.apache.cassandra.db.marshal.AbstractType<T>
org.apache.cassandra.db.marshal.CollectionType<java.util.Map<K,V>>
org.apache.cassandra.db.marshal.MapType<K,V>
- All Implemented Interfaces:
- java.util.Comparator<java.nio.ByteBuffer>
public class MapType<K,V>
- extends CollectionType<java.util.Map<K,V>>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
keys
public final AbstractType<K> keys
values
public final AbstractType<V> values
getInstance
public static MapType<?,?> getInstance(TypeParser parser)
throws ConfigurationException,
SyntaxException
- Throws:
ConfigurationException
SyntaxException
getInstance
public static <K,V> MapType<K,V> getInstance(AbstractType<K> keys,
AbstractType<V> values)
nameComparator
public AbstractType<K> nameComparator()
- Specified by:
nameComparator
in class CollectionType<java.util.Map<K,V>>
valueComparator
public AbstractType<V> valueComparator()
- Specified by:
valueComparator
in class CollectionType<java.util.Map<K,V>>
compose
public java.util.Map<K,V> compose(java.nio.ByteBuffer bytes)
- Specified by:
compose
in class AbstractType<java.util.Map<K,V>>
decompose
public java.nio.ByteBuffer decompose(java.util.Map<K,V> value)
- Layout is:
<n><sk_1><k_1><sv_1><v_1>...<sk_n><k_n><sv_n><v_n>
where:
n is the number of elements
sk_i is the number of bytes composing the ith key k_i
k_i is the sk_i bytes composing the ith key
sv_i is the number of bytes composing the ith value v_i
v_i is the sv_i bytes composing the ith value
- Specified by:
decompose
in class AbstractType<java.util.Map<K,V>>
appendToStringBuilder
protected void appendToStringBuilder(java.lang.StringBuilder sb)
- Specified by:
appendToStringBuilder
in class CollectionType<java.util.Map<K,V>>
serialize
public java.nio.ByteBuffer serialize(java.util.List<Pair<java.nio.ByteBuffer,IColumn>> columns)
- Creates the same output than decompose, but from the internal representation.
- Specified by:
serialize
in class CollectionType<java.util.Map<K,V>>
Copyright © 2013 The Apache Software Foundation