Class 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:
    Serialized Form
    • Constructor Detail

      • NotP

        public NotP​(P<V> p)
    • Method Detail

      • 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>
      • negate

        public P<V> negate()
        Returns the original unwrapped P contained within this NotP, as 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>