com.hammurapi.extract

## Class True<T,C>

- java.lang.Object
- - com.hammurapi.extract.True<T,C>

- Type Parameters:
    `T` -
    `C` -
  All Implemented Interfaces:
    Extractor<T,Boolean,C>, Predicate<T,C>

      public class True<T,C>
      extends Object
      implements Predicate<T,C>

  Predicate which always evaluates to true. This predicate is primarily used for comparison

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ComparisonResult` | `compareTo(Extractor<T,Boolean,C> otherPredicate)` Compares two extractors
    `Boolean` | `extract(C context, Map<C,Map<Extractor<T,? super Boolean,C>,? super Boolean>> cache, T... obj)` Extracts value.
    `double` | `getCost()`
    `static <T,C> True<T,C>` | `getInstance()`
    `boolean` | `isContextDependent()`
    `Set<Integer>` | `parameterIndices()`
    `String` | `toString()`

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

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

- - ### Method Detail

    - #### getInstance

          public static <T,C> True<T,C> getInstance()

    - #### compareTo

          public ComparisonResult compareTo(Extractor<T,Boolean,C> otherPredicate)

      Description copied from interface: `Extractor`
      Compares two extractors
      Specified by:
        `compareTo` in interface `Extractor<T,Boolean,C>`
      Parameters:
        `otherPredicate` - Other extractor
      Returns:
        Comparison result.

    - #### extract

          public Boolean extract(C context,
                        Map<C,Map<Extractor<T,? super Boolean,C>,? super Boolean>> cache,
                        T... obj)

      Description copied from interface: `Extractor`
      Extracts value.
      Specified by:
        `extract` in interface `Extractor<T,Boolean,C>`
      Parameters:
        `context` - Extraction context. Extraction context may provide source for constants for comparison with object values.
        `cache` - Cache of values extracted from the source object for the given context. Composite extractors can use cache to find already extracted values and to store extracted values. For example extractor which extracts object area as obj.getWidth()*obj.getHeight() may find that width was already extracted and getWidth() doesn't have to be invoked. So it invokes getHeight() and stores returned value to the cache. It also calculates object area and stores it to the cache. A particular cache instance is valid only for a particular obj array, i.e. it can be re-used between extractors but not between arguments.
        `obj` - Source objects.
      Returns:
        Extracted value.

    - #### isContextDependent

          public boolean isContextDependent()

      Specified by:
        `isContextDependent` in interface `Extractor<T,Boolean,C>`
      Returns:
        True if extractor uses context for extraction. False if only object(s) are used.

    - #### parameterIndices

          public Set<Integer> parameterIndices()

      Specified by:
        `parameterIndices` in interface `Extractor<T,Boolean,C>`
      Returns:
        Indexes of objects which this extractor uses for computations.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getCost

          public double getCost()

      Specified by:
        `getCost` in interface `Extractor<T,Boolean,C>`
      Returns:
        Extractor evaluation cost. Cost is used for optimization of computation intensive algorithms. E.g. in Store it is used for selection of indices for query operations.