org.apache.cassandra.cql3
Class Term

java.lang.Object
  extended by org.apache.cassandra.cql3.Term

public class Term
extends java.lang.Object

A term parsed from a CQL statement.


Field Summary
 int bindIndex
           
 boolean isToken
           
 
Constructor Summary
Term(long value, org.apache.cassandra.cql3.TermType type)
           
Term(java.lang.String text, int type)
          Create new Term instance from a string, and an integer that corresponds with the token ID from CQLParser.
Term(java.lang.String text, int type, int index)
           
Term(java.lang.String text, org.apache.cassandra.cql3.TermType type)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Token getAsToken(AbstractType<?> validator, java.util.List<java.nio.ByteBuffer> variables, IPartitioner<?> p)
           
 java.nio.ByteBuffer getByteBuffer(AbstractType<?> validator, java.util.List<java.nio.ByteBuffer> variables)
          Returns the typed value, serialized to a ByteBuffer according to a comparator/validator.
 java.lang.String getText()
          Returns the text parsed to create this term.
 org.apache.cassandra.cql3.TermType getType()
          Obtain the term's type.
 int hashCode()
           
 boolean isBindMarker()
           
static Term tokenOf(Term t)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

bindIndex

public final int bindIndex

isToken

public final boolean isToken
Constructor Detail

Term

public Term(java.lang.String text,
            org.apache.cassandra.cql3.TermType type)

Term

public Term(java.lang.String text,
            int type)
Create new Term instance from a string, and an integer that corresponds with the token ID from CQLParser.

Parameters:
text - the text representation of the term.
type - the term's type as an integer token ID.

Term

public Term(long value,
            org.apache.cassandra.cql3.TermType type)

Term

public Term(java.lang.String text,
            int type,
            int index)
Method Detail

tokenOf

public static Term tokenOf(Term t)

getText

public java.lang.String getText()
Returns the text parsed to create this term.

Returns:
the string term acquired from a CQL statement.

getByteBuffer

public java.nio.ByteBuffer getByteBuffer(AbstractType<?> validator,
                                         java.util.List<java.nio.ByteBuffer> variables)
                                  throws org.apache.cassandra.thrift.InvalidRequestException
Returns the typed value, serialized to a ByteBuffer according to a comparator/validator.

Returns:
a ByteBuffer of the value.
Throws:
org.apache.cassandra.thrift.InvalidRequestException - if unable to coerce the string to its type.

getAsToken

public Token getAsToken(AbstractType<?> validator,
                        java.util.List<java.nio.ByteBuffer> variables,
                        IPartitioner<?> p)
                 throws org.apache.cassandra.thrift.InvalidRequestException
Throws:
org.apache.cassandra.thrift.InvalidRequestException

getType

public org.apache.cassandra.cql3.TermType getType()
Obtain the term's type.

Returns:
the type

isBindMarker

public boolean isBindMarker()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2012 The Apache Software Foundation