org.apache.cassandra.db.marshal
Class AbstractType<T>

java.lang.Object
  extended by org.apache.cassandra.db.marshal.AbstractType<T>
All Implemented Interfaces:
java.util.Comparator<java.nio.ByteBuffer>
Direct Known Subclasses:
AsciiType, BytesType, IntegerType, LexicalUUIDType, LocalByPartionerType, LongType, TimeUUIDType, UTF8Type

public abstract class AbstractType<T>
extends java.lang.Object
implements java.util.Comparator<java.nio.ByteBuffer>

Specifies a Comparator for a specific type of ByteBuffer. Note that empty ByteBuffer are used to represent "start at the beginning" or "stop at the end" arguments to get_slice, so the Comparator should always handle those values even if they normally do not represent a valid ByteBuffer for the type being compared.


Field Summary
 java.util.Comparator<IColumn> columnComparator
           
 java.util.Comparator<IColumn> columnReverseComparator
           
 java.util.Comparator<IndexHelper.IndexInfo> indexComparator
           
 java.util.Comparator<IndexHelper.IndexInfo> indexReverseComparator
           
 java.util.Comparator<java.nio.ByteBuffer> reverseComparator
           
 
Constructor Summary
protected AbstractType()
           
 
Method Summary
abstract  T compose(java.nio.ByteBuffer bytes)
           
abstract  java.nio.ByteBuffer decompose(T value)
           
 java.nio.ByteBuffer fromString(java.lang.String source)
          get a byte representation of the given string.
 java.lang.String getColumnsString(java.util.Collection<IColumn> columns)
           
 java.util.Comparator<java.nio.ByteBuffer> getReverseComparator()
           
abstract  java.lang.String getString(java.nio.ByteBuffer bytes)
          get a string representation of the bytes suitable for log messages
 java.lang.String getString(java.util.Collection<java.nio.ByteBuffer> names)
           
abstract  void validate(java.nio.ByteBuffer bytes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
compare, equals
 

Field Detail

indexComparator

public final java.util.Comparator<IndexHelper.IndexInfo> indexComparator

indexReverseComparator

public final java.util.Comparator<IndexHelper.IndexInfo> indexReverseComparator

columnComparator

public final java.util.Comparator<IColumn> columnComparator

columnReverseComparator

public final java.util.Comparator<IColumn> columnReverseComparator

reverseComparator

public final java.util.Comparator<java.nio.ByteBuffer> reverseComparator
Constructor Detail

AbstractType

protected AbstractType()
Method Detail

getReverseComparator

public java.util.Comparator<java.nio.ByteBuffer> getReverseComparator()

getString

public abstract java.lang.String getString(java.nio.ByteBuffer bytes)
get a string representation of the bytes suitable for log messages


fromString

public java.nio.ByteBuffer fromString(java.lang.String source)
get a byte representation of the given string. defaults to unsupportedoperation so people deploying custom Types can update at their leisure.


compose

public abstract T compose(java.nio.ByteBuffer bytes)

decompose

public abstract java.nio.ByteBuffer decompose(T value)

validate

public abstract void validate(java.nio.ByteBuffer bytes)
                       throws MarshalException
Throws:
MarshalException

getString

public java.lang.String getString(java.util.Collection<java.nio.ByteBuffer> names)

getColumnsString

public java.lang.String getColumnsString(java.util.Collection<IColumn> columns)


Copyright © 2011 The Apache Software Foundation