com.hammurapi.extract

## Class TimeIntervalPredicate<T,C>

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

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

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

  This predicate evaluates to true for `timeInterval` after construction. Then it evaluates to false.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimeIntervalPredicate(TimeUnit timeUnit, long interval)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ComparisonResult` | `compareTo(Extractor<T,Boolean,C> other)` Compares two extractors
    `boolean` | `equals(Object obj)`
    `Boolean` | `extract(C context, Map<C,Map<Extractor<T,? super Boolean,C>,? super Boolean>> cache, T... obj)` Extracts value.
    `double` | `getCost()`
    `int` | `hashCode()`
    `boolean` | `isContextDependent()`
    `Set<Integer>` | `parameterIndices()`

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

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TimeIntervalPredicate

          public TimeIntervalPredicate(TimeUnit timeUnit,
                               long interval)

  - ### Method Detail

    - #### 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.

    - #### parameterIndices

          public Set<Integer> parameterIndices()

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

    - #### 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.

    - #### compareTo

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

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

    - #### 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.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`