com.hammurapi.extract

## Interface CompositePredicate<T,PC extends Collection<Predicate<T,C>>,C,S extends CompositePredicate<T,PC,C,S>>

- Type Parameters:
    `T` -
    `PC` - Parts collection type.
    `C` - Context type.
  All Superinterfaces:
    Cloneable, Extractor<T,Boolean,C>, FacadeExtractor<T,Boolean,C>, Mappable<T,Boolean,C>, Predicate<T,C>
  All Known Subinterfaces:
    CommutativeCompositePredicate<T,C,S>
  All Known Implementing Classes:
    And, CommutativeAnd, CommutativeOr, Or

      public interface CompositePredicate<T,PC extends Collection<Predicate<T,C>>,C,S extends CompositePredicate<T,PC,C,S>>
      extends Predicate<T,C>, FacadeExtractor<T,Boolean,C>, Mappable<T,Boolean,C>, Cloneable

  Predicate which is a composition of other predicates, e.g. AND or OR operations.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `S` | `add(Predicate<T,C> part)`
    `PC` | `getParts()`
    `Predicate<T,C>` | `normalize()` Normalizes predicate by removing less restrictive parts in AND or more restrictive parts in OR, and analyzing if predicate is always TRUE or always FALSE.
    `Predicate<T,C>` | `remove(Predicate<T,C> part)`

    - ### Methods inherited from interface com.hammurapi.extract.Extractor

      `compareTo, extract, getCost, isContextDependent, parameterIndices`

    - ### Methods inherited from interface com.hammurapi.extract.Mappable

      `map`

- - ### Method Detail

    - #### getParts

          PC getParts()

      Returns:
        Sub-predicates.

    - #### remove

          Predicate<T,C> remove(Predicate<T,C> part)

      Parameters:
        `part` -
      Returns:
        Returns composite predicate of the same type without given part. If there is one remaining part then this part is returned.

    - #### normalize

          Predicate<T,C> normalize()

      Normalizes predicate by removing less restrictive parts in AND or more restrictive parts in OR, and analyzing if predicate is always TRUE or always FALSE.
      Returns:
        Normalized predicate, True if predicate always evaluates to true, False if predicate always evaluates to false.

    - #### add

          S add(Predicate<T,C> part)