org.apache.cassandra.cql3
Interface Term

All Known Implementing Classes:
AbstractMarker, Constants.Marker, Constants.Value, FunctionCall, Lists.Marker, Lists.Value, Maps.Marker, Maps.Value, Sets.Marker, Sets.Value, Term.NonTerminal, Term.Terminal

public interface Term

A CQL3 term, i.e. a column value with or without bind variables. A Term can be either terminal or non terminal. A term object is one that is typed and is obtained from a raw term (Term.Raw) by poviding the actual receiver to which the term is supposed to be a value of.


Nested Class Summary
static class Term.NonTerminal
          A non terminal term, i.e.
static interface Term.Raw
          A parsed, non prepared (thus untyped) term.
static class Term.Terminal
          A terminal term, i.e.
 
Method Summary
 Term.Terminal bind(java.util.List<java.nio.ByteBuffer> values)
          Bind the values in this term to the values contained in values.
 java.nio.ByteBuffer bindAndGet(java.util.List<java.nio.ByteBuffer> values)
          A shorter for bind(values).get().
 void collectMarkerSpecification(ColumnSpecification[] boundNames)
          Collects the column specification for the bind variables in this Term.
 

Method Detail

collectMarkerSpecification

void collectMarkerSpecification(ColumnSpecification[] boundNames)
Collects the column specification for the bind variables in this Term. This is obviously a no-op if the term is Terminal.

Parameters:
boundNames - the list of column specification where to collect the bind variables of this term in.

bind

Term.Terminal bind(java.util.List<java.nio.ByteBuffer> values)
                   throws InvalidRequestException
Bind the values in this term to the values contained in values. This is obviously a no-op if the term is Terminal.

Parameters:
values - the values to bind markers to.
Returns:
the result of binding all the variables of this NonTerminal (or 'this' if the term is terminal).
Throws:
InvalidRequestException

bindAndGet

java.nio.ByteBuffer bindAndGet(java.util.List<java.nio.ByteBuffer> values)
                               throws InvalidRequestException
A shorter for bind(values).get(). We expose it mainly because for constants it can avoids allocating a temporary object between the bind and the get (note that we still want to be able to separate bind and get for collections).

Throws:
InvalidRequestException


Copyright © 2013 The Apache Software Foundation