com.thinkaurelius.titan.graphdb.query

## Interface ElementQuery<R extends TitanElement,B extends BackendQuery<B>>

- All Superinterfaces:
    Query
  All Known Implementing Classes:
    GraphCentricQuery, VertexCentricQuery

      public interface ElementQuery<R extends TitanElement,B extends BackendQuery<B>>
      extends Query

  A query that returns `TitanElement`s. This query can consist of multiple sub-queries that together form the desired result set.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Field Summary

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

      `NO_LIMIT`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Comparator<R>` | `getSortOrder()` Returns the expected sort order of this query if any was specified.
    `BackendQueryHolder<B>` | `getSubQuery(int position)` Returns the backend query at the given position that comprises this ElementQuery
    `boolean` | `hasDuplicateResults()` Whether the combination of the individual sub-queries can result in duplicate results.
    `boolean` | `isEmpty()` Whether the result set of this query is empty
    `boolean` | `isSorted()` Whether this query expects the results to be in a particular sort order.
    `boolean` | `matches(R element)` Whether the given element matches the conditions of this query.
    `int` | `numSubQueries()` Returns the number of sub-queries this query is comprised of.

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

      `getLimit, hasLimit`

- - ### Method Detail

    - #### hasDuplicateResults

          boolean hasDuplicateResults()

      Whether the combination of the individual sub-queries can result in duplicate results. Indicates to the query executor whether the results need to be de-duplicated
      Returns:
        true, if duplicate results are possible, else false

    - #### isEmpty

          boolean isEmpty()

      Whether the result set of this query is empty
      Returns:

    - #### numSubQueries

          int numSubQueries()

      Returns the number of sub-queries this query is comprised of.
      Returns:

    - #### getSubQuery

          BackendQueryHolder<B> getSubQuery(int position)

      Returns the backend query at the given position that comprises this ElementQuery
      Parameters:
        `position` -
      Returns:

    - #### matches

          boolean matches(R element)

      Whether the given element matches the conditions of this query. Used for result filtering if the result set returned by the query executor is not fitted.
      Parameters:
        `element` -
      Returns:

    - #### isSorted

          boolean isSorted()

      Whether this query expects the results to be in a particular sort order.
      Returns:

    - #### getSortOrder

          Comparator<R> getSortOrder()

      Returns the expected sort order of this query if any was specified. Check `isSorted()` first.
      Returns:

Copyright © 2012–2014. All rights reserved.