org.apache.cassandra.cql3
Class Term
java.lang.Object
org.apache.cassandra.cql3.Term
public class Term
- extends java.lang.Object
A term parsed from a CQL statement.
Constructor Summary |
Term(long value,
Term.Type 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,
Term.Type type)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
bindIndex
public final int bindIndex
isToken
public final boolean isToken
Term
public Term(java.lang.String text,
Term.Type 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,
Term.Type type)
Term
public Term(java.lang.String text,
int type,
int index)
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 InvalidRequestException
- Returns the typed value, serialized to a ByteBuffer according to a
comparator/validator.
- Returns:
- a ByteBuffer of the value.
- Throws:
InvalidRequestException
- if unable to coerce the string to its type.
getType
public Term.Type getType()
- Obtain the term's type.
- Returns:
- the type
isBindMarker
public boolean isBindMarker()
asList
public java.util.List<Term> asList()
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 © 2013 The Apache Software Foundation