java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.P<V>
org.apache.tinkerpop.gremlin.process.traversal.NotP<V>
All Implemented Interfaces:
Serializable, Cloneable, Predicate<V>

public class NotP<V> extends P<V>
A NotP wraps a P and represents its negation. This class provides the logical NOT operation for predicates, inverting the result of the wrapped predicate's test method.
See Also:
  • Constructor Details

    • NotP

      public NotP(P<V> p)
  • Method Details

    • getValue

      public V getValue()
      Gets the current value to be passed to the predicate for testing.
      Overrides:
      getValue in class P<V>
    • setValue

      public void setValue(V value)
      Overrides:
      setValue in class P<V>
    • toString

      public String toString()
      Overrides:
      toString in class P<V>
    • getWrapped

      public P<V> getWrapped()
      Returns the inner predicate wrapped by this NotP.
    • negate

      public P<V> negate()
      Returns the original unwrapped P, since double negation cancels out.
      Specified by:
      negate in interface Predicate<V>
      Overrides:
      negate in class P<V>
    • clone

      public P<V> clone()
      Overrides:
      clone in class P<V>
    • hasTraversal

      public boolean hasTraversal()
      Description copied from class: P
      Determines if this predicate holds a child traversal whose result is resolved at runtime.
      Overrides:
      hasTraversal in class P<V>
    • isResolvedEmpty

      public boolean isResolvedEmpty()
      Description copied from class: P
      Returns true if the most recent call to P.resolve(Traverser.Admin) produced no results for a scalar predicate, meaning there is no meaningful comparison value.
      Overrides:
      isResolvedEmpty in class P<V>
    • resolve

      public void resolve(Traverser.Admin<?> traverser)
      Description copied from class: P
      Resolves the child traversal(s) against the given traverser, replacing the traversal value with the resolved literal(s) for this test cycle. If no traversal is present, this method returns immediately.
      Overrides:
      resolve in class P<V>