com.thinkaurelius.titan.graphdb.query.graph

## Class GraphCentricQuery

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

- All Implemented Interfaces:
    ElementQuery<TitanElement,JointIndexQuery>, Query

      public class GraphCentricQuery
      extends BaseQuery
      implements ElementQuery<TitanElement,JointIndexQuery>

  An executable `ElementQuery` for `TitanGraphQuery`. This query contains the condition, and only one sub-query `JointIndexQuery`. It also maintains the ordering for the query result which is needed by the `QueryProcessor` to correctly order the result.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Field Summary

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

      `NO_LIMIT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GraphCentricQuery(ElementCategory resultType, Condition<TitanElement> condition, OrderList orders, BackendQueryHolder<JointIndexQuery> indexQuery, int limit)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static GraphCentricQuery` | `emptyQuery(ElementCategory resultType)`
    `boolean` | `equals(Object other)`
    `Condition<TitanElement>` | `getCondition()`
    `OrderList` | `getOrder()`
    `ElementCategory` | `getResultType()`
    `Comparator<TitanElement>` | `getSortOrder()` Returns the expected sort order of this query if any was specified.
    `BackendQueryHolder<JointIndexQuery>` | `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.
    `int` | `hashCode()`
    `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(TitanElement element)` Whether the given element matches the conditions of this query.
    `int` | `numSubQueries()` Returns the number of sub-queries this query is comprised of.
    `String` | `toString()`

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

      `getLimit, hasLimit, setLimit`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

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

      `getLimit, hasLimit`

- - ### Constructor Detail

    - #### GraphCentricQuery

          public GraphCentricQuery(ElementCategory resultType,
                           Condition<TitanElement> condition,
                           OrderList orders,
                           BackendQueryHolder<JointIndexQuery> indexQuery,
                           int limit)

  - ### Method Detail

    - #### emptyQuery

          public static final GraphCentricQuery emptyQuery(ElementCategory resultType)

    - #### getCondition

          public Condition<TitanElement> getCondition()

    - #### getResultType

          public ElementCategory getResultType()

    - #### getOrder

          public OrderList getOrder()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object other)

      Overrides:
        `equals` in class `Object`

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `ElementQuery`
      Whether the result set of this query is empty
      Specified by:
        `isEmpty` in interface `ElementQuery<TitanElement,JointIndexQuery>`
      Returns:

    - #### numSubQueries

          public int numSubQueries()

      Description copied from interface: `ElementQuery`
      Returns the number of sub-queries this query is comprised of.
      Specified by:
        `numSubQueries` in interface `ElementQuery<TitanElement,JointIndexQuery>`
      Returns:

    - #### getSubQuery

          public BackendQueryHolder<JointIndexQuery> getSubQuery(int position)

      Description copied from interface: `ElementQuery`
      Returns the backend query at the given position that comprises this ElementQuery
      Specified by:
        `getSubQuery` in interface `ElementQuery<TitanElement,JointIndexQuery>`
      Returns:

    - #### isSorted

          public boolean isSorted()

      Description copied from interface: `ElementQuery`
      Whether this query expects the results to be in a particular sort order.
      Specified by:
        `isSorted` in interface `ElementQuery<TitanElement,JointIndexQuery>`
      Returns:

    - #### getSortOrder

          public Comparator<TitanElement> getSortOrder()

      Description copied from interface: `ElementQuery`
      Returns the expected sort order of this query if any was specified. Check `ElementQuery.isSorted()` first.
      Specified by:
        `getSortOrder` in interface `ElementQuery<TitanElement,JointIndexQuery>`
      Returns:

    - #### hasDuplicateResults

          public boolean hasDuplicateResults()

      Description copied from interface: `ElementQuery`
      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
      Specified by:
        `hasDuplicateResults` in interface `ElementQuery<TitanElement,JointIndexQuery>`
      Returns:
        true, if duplicate results are possible, else false

    - #### matches

          public boolean matches(TitanElement element)

      Description copied from interface: `ElementQuery`
      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.
      Specified by:
        `matches` in interface `ElementQuery<TitanElement,JointIndexQuery>`
      Returns:

Copyright © 2012–2014. All rights reserved.