com.thinkaurelius.titan.graphdb.query.graph

## Class IndexQueryBuilder

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.query.BaseQuery
  - - com.thinkaurelius.titan.graphdb.query.graph.IndexQueryBuilder

- All Implemented Interfaces:
    TitanIndexQuery, Query

      public class IndexQueryBuilder
      extends BaseQuery
      implements TitanIndexQuery

  Implementation of `TitanIndexQuery` for string based queries that are issued directly against the specified indexing backend. It is assumed that the given string conforms to the query language of the indexing backend. This class does not understand or verify the provided query. However, it will introspect the query and replace any reference to `v.SOME_KEY`, `e.SOME_KEY` or `p.SOME_KEY` with the respective key reference. This replacement is 'dumb' in the sense that it relies on simple string replacements to accomplish this. If the key contains special characters (in particular space) then it must be encapsulated in quotation marks. In addition to the query string, a number of parameters can be specified which will be passed verbatim to the indexing backend during query execution. This class essentially just acts as a builder, uses the `IndexSerializer` to execute the query, and then post-processes the result set to return to the user.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.thinkaurelius.titan.core.TitanIndexQuery

      `TitanIndexQuery.Result<V extends com.tinkerpop.blueprints.Element>`

  - ### Field Summary

    - ### Fields inherited from interface com.thinkaurelius.titan.graphdb.query.Query

      `NO_LIMIT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexQueryBuilder(StandardTitanTx tx, IndexSerializer serializer)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IndexQueryBuilder` | `addParameter(Parameter para)` Adds the given parameter to the list of parameters of this query.
    `IndexQueryBuilder` | `addParameters(Iterable<Parameter> paras)` Adds the given parameters to the list of parameters of this query.
    `IndexQueryBuilder` | `addParameters(Parameter... paras)` Adds the given parameters to the list of parameters of this query.
    `Iterable<TitanIndexQuery.Result<com.tinkerpop.blueprints.Edge>>` | `edges()` Returns all edges that match the query in the indexing backend.
    `String` | `getIndex()`
    `int` | `getOffset()`
    `Parameter[]` | `getParameters()`
    `String` | `getPrefix()`
    `String` | `getQuery()`
    `String` | `getUnknownKeyName()`
    `IndexQueryBuilder` | `limit(int limit)` Specifies the maxium number of elements to return
    `IndexQueryBuilder` | `offset(int offset)` Specifies the offset of the query.
    `Iterable<TitanIndexQuery.Result<TitanProperty>>` | `properties()` Returns all properties that match the query in the indexing backend.
    `IndexQueryBuilder` | `setIndex(String indexName)`
    `IndexQueryBuilder` | `setQuery(String query)`
    `Iterable<TitanIndexQuery.Result<com.tinkerpop.blueprints.Vertex>>` | `vertices()` Returns all vertices that match the query in the indexing backend.

    - ### Methods inherited from class com.thinkaurelius.titan.graphdb.query.BaseQuery

      `getLimit, hasLimit, setLimit`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IndexQueryBuilder

          public IndexQueryBuilder(StandardTitanTx tx,
                           IndexSerializer serializer)

  - ### Method Detail

    - #### getIndex

          public String getIndex()

    - #### getParameters

          public Parameter[] getParameters()

    - #### getQuery

          public String getQuery()

    - #### getOffset

          public int getOffset()

    - #### getPrefix

          public String getPrefix()

    - #### getUnknownKeyName

          public String getUnknownKeyName()

    - #### setIndex

          public IndexQueryBuilder setIndex(String indexName)

    - #### setQuery

          public IndexQueryBuilder setQuery(String query)

    - #### offset

          public IndexQueryBuilder offset(int offset)

      Description copied from interface: `TitanIndexQuery`
      Specifies the offset of the query. Query results will be retrieved starting at the given offset.
      Specified by:
        `offset` in interface `TitanIndexQuery`
      Returns:

    - #### limit

          public IndexQueryBuilder limit(int limit)

      Description copied from interface: `TitanIndexQuery`
      Specifies the maxium number of elements to return
      Specified by:
        `limit` in interface `TitanIndexQuery`
      Returns:

    - #### addParameter

          public IndexQueryBuilder addParameter(Parameter para)

      Description copied from interface: `TitanIndexQuery`
      Adds the given parameter to the list of parameters of this query. Parameters are passed right through to the indexing backend to modify the query behavior.
      Specified by:
        `addParameter` in interface `TitanIndexQuery`
      Returns:

    - #### addParameters

          public IndexQueryBuilder addParameters(Iterable<Parameter> paras)

      Description copied from interface: `TitanIndexQuery`
      Adds the given parameters to the list of parameters of this query. Parameters are passed right through to the indexing backend to modify the query behavior.
      Specified by:
        `addParameters` in interface `TitanIndexQuery`
      Returns:

    - #### addParameters

          public IndexQueryBuilder addParameters(Parameter... paras)

      Description copied from interface: `TitanIndexQuery`
      Adds the given parameters to the list of parameters of this query. Parameters are passed right through to the indexing backend to modify the query behavior.
      Specified by:
        `addParameters` in interface `TitanIndexQuery`
      Returns:

    - #### vertices

          public Iterable<TitanIndexQuery.Result<com.tinkerpop.blueprints.Vertex>> vertices()

      Description copied from interface: `TitanIndexQuery`
      Returns all vertices that match the query in the indexing backend.
      Specified by:
        `vertices` in interface `TitanIndexQuery`
      Returns:

    - #### edges

          public Iterable<TitanIndexQuery.Result<com.tinkerpop.blueprints.Edge>> edges()

      Description copied from interface: `TitanIndexQuery`
      Returns all edges that match the query in the indexing backend.
      Specified by:
        `edges` in interface `TitanIndexQuery`
      Returns:

    - #### properties

          public Iterable<TitanIndexQuery.Result<TitanProperty>> properties()

      Description copied from interface: `TitanIndexQuery`
      Returns all properties that match the query in the indexing backend.
      Specified by:
        `properties` in interface `TitanIndexQuery`
      Returns:

Copyright © 2012–2014. All rights reserved.