Class TemporalFilter<T>

Type Parameters:
T - the type of resources (e.g. Feature) used as inputs.
All Implemented Interfaces:
Serializable, Predicate<T>, Filter<T>, Optimization.OnFilter<T>
Direct Known Subclasses:
TemporalFilter.After, TemporalFilter.AnyInteracts, TemporalFilter.Before, TemporalFilter.Begins, TemporalFilter.BegunBy, TemporalFilter.Contains, TemporalFilter.During, TemporalFilter.EndedBy, TemporalFilter.Ends, TemporalFilter.Equals, TemporalFilter.Meets, TemporalFilter.MetBy, TemporalFilter.OverlappedBy, TemporalFilter.Overlaps

abstract class TemporalFilter<T> extends BinaryFunction<T,Object,Object> implements Filter<T>, Optimization.OnFilter<T>
Temporal operations between a period and an instant. The nature of the operation depends on the subclass. Subclasses shall override at least one of following methods:
Since:
1.1
Version:
1.1
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
  • Constructor Details

    • TemporalFilter

      TemporalFilter(Expression<? super T,?> expression1, Expression<? super T,?> expression2)
      Creates a new temporal function.
      Parameters:
      expression1 - the first of the two expressions to be used by this function.
      expression2 - the second of the two expressions to be used by this function.
  • Method Details

    • toInstant

      private static Instant toInstant(Instant instant)
      Converts a GeoAPI instant to a Java instant. This is a temporary method to be removed after we revisited org.apache.sis.internal.geoapi.temporal package.
      Parameters:
      instant - the GeoAPI instant, or null.
      Returns:
      the Java instant, or null.
    • isBefore

      private static boolean isBefore(Instant self, Instant other)
      Returns true if self is non null and before other. This is an helper function for evaluate(…) methods implementations.
    • isAfter

      private static boolean isAfter(Instant self, Instant other)
      Returns true if self is non null and after other. This is an helper function for evaluate(…) methods implementations.
    • isEqual

      private static boolean isEqual(Instant self, Instant other)
      Returns true if self is non null and equal to other. This is an helper function for evaluate(…) methods implementations.
    • isBefore

      private static boolean isBefore(Instant self, Instant other)
      Returns true if self is non null and before other. This is an helper function for evaluate(…) methods implementations.
    • isAfter

      private static boolean isAfter(Instant self, Instant other)
      Returns true if self is non null and after other. This is an helper function for evaluate(…) methods implementations.
    • isEqual

      private static boolean isEqual(Instant self, Instant other)
      Returns true if self is non null and equal to other. This is an helper function for evaluate(…) methods implementations.
    • test

      public final boolean test(T candidate)
      Determines if the test(s) represented by this filter passes with the given operands. Values of BinaryFunction.expression1 and BinaryFunction.expression2 shall be two single values.
      Specified by:
      test in interface Filter<T>
      Specified by:
      test in interface Predicate<T>
      Parameters:
      candidate - the object (often a Feature instance) to evaluate.
      Returns:
      true if the test(s) are passed for the provided object.
    • evaluate

      protected boolean evaluate(Instant self, Instant other)
      Evaluates the filter between two instants. Both arguments given to this method are non-null. The self and other argument names are chosen to match ISO 19108 tables.
    • evaluate

      protected boolean evaluate(Period self, Instant other)
      Evaluates the filter between a period and an instant. Both arguments given to this method are non-null, but period begin or end instant may be null. The self and other argument names are chosen to match ISO 19108 tables.
    • evaluate

      protected boolean evaluate(Period self, Period other)
      Evaluates the filter between two periods. Both arguments given to this method are non-null, but period begin or end instant may be null. The self and other argument names are chosen to match ISO 19108 tables.