org.apache.cassandra.db.marshal
Class MapType<K,V>

java.lang.Object
  extended by org.apache.cassandra.db.marshal.AbstractType<T>
      extended by org.apache.cassandra.db.marshal.CollectionType<java.util.Map<K,V>>
          extended by 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>>


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.cassandra.db.marshal.CollectionType
CollectionType.Kind
 
Field Summary
 AbstractType<K> keys
           
 AbstractType<V> values
           
 
Fields inherited from class org.apache.cassandra.db.marshal.CollectionType
kind
 
Fields inherited from class org.apache.cassandra.db.marshal.AbstractType
columnComparator, columnReverseComparator, indexComparator, indexReverseComparator, onDiskAtomComparator, reverseComparator
 
Method Summary
protected  void appendToStringBuilder(java.lang.StringBuilder sb)
           
 java.util.Map<K,V> compose(java.nio.ByteBuffer bytes)
           
 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
static
<K,V> MapType<K,V>
getInstance(AbstractType<K> keys, AbstractType<V> values)
           
static MapType<?,?> getInstance(TypeParser parser)
           
 AbstractType<K> nameComparator()
           
 java.nio.ByteBuffer serialize(java.util.List<Pair<java.nio.ByteBuffer,IColumn>> columns)
          Creates the same output than decompose, but from the internal representation.
 AbstractType<V> valueComparator()
           
 
Methods inherited from class org.apache.cassandra.db.marshal.CollectionType
asCQL3Type, compare, fromString, getString, getUnsignedShort, isCollection, pack, pack, toString, validate
 
Methods inherited from class org.apache.cassandra.db.marshal.AbstractType
compareCollectionMembers, fromStringCQL2, getColumnsString, getReverseComparator, getString, isCommutative, isCompatibleWith, parseDefaultParameters, validateCollectionMember
 
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
 

Field Detail

keys

public final AbstractType<K> keys

values

public final AbstractType<V> values
Method Detail

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