com.thinkaurelius.titan.graphdb.query

## Interface TitanPredicate

- All Superinterfaces:
    com.tinkerpop.blueprints.Predicate
  All Known Implementing Classes:
    Cmp, Contain, Geo, Text

      public interface TitanPredicate
      extends com.tinkerpop.blueprints.Predicate

  Titan's extension of Blueprint's `Predicate` interface. Contains some custom methods that Titan needs for query answering and evaluation. This class contains a subclass used to convert Blueprint's `Predicate` to the corresponding Titan predicates.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `TitanPredicate.Converter`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `evaluate(Object value, Object condition)`
    `boolean` | `hasNegation()` Whether this predicate has a predicate that is semantically its negation.
    `boolean` | `isQNF()` Returns true if this predicate is in query normal form.
    `boolean` | `isValidCondition(Object condition)` Whether the given condition is a valid condition for this predicate.
    `boolean` | `isValidValueType(Class<?> clazz)` Whether the given class is a valid data type for a value to which this predicate may be applied.
    `TitanPredicate` | `negate()` Returns the negation of this predicate if it exists, otherwise an exception is thrown.

- - ### Method Detail

    - #### isValidCondition

          boolean isValidCondition(Object condition)

      Whether the given condition is a valid condition for this predicate. For instance, the `Cmp.GREATER_THAN` would require that the condition is comparable and not null.
      Parameters:
        `condition` -
      Returns:

    - #### isValidValueType

          boolean isValidValueType(Class<?> clazz)

      Whether the given class is a valid data type for a value to which this predicate may be applied. For instance, the `Cmp.GREATER_THAN` can only be applied to `Comparable` values.
      Parameters:
        `clazz` -
      Returns:

    - #### hasNegation

          boolean hasNegation()

      Whether this predicate has a predicate that is semantically its negation. For instance, `Cmp.EQUAL` and `Cmp.NOT_EQUAL` are negatives of each other.
      Returns:

    - #### negate

          TitanPredicate negate()

      Returns the negation of this predicate if it exists, otherwise an exception is thrown. Check `hasNegation()` first.
      Returns:

    - #### isQNF

          boolean isQNF()

      Returns true if this predicate is in query normal form.
      Returns:

    - #### evaluate

          boolean evaluate(Object value,
                         Object condition)

      Specified by:
        `evaluate` in interface `com.tinkerpop.blueprints.Predicate`

Copyright © 2012–2014. All rights reserved.