Package org.apache.sis.filter
Class TemporalFilter<T>
java.lang.Object
org.apache.sis.internal.filter.Node
org.apache.sis.filter.BinaryFunction<T,Object,Object>
org.apache.sis.filter.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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classThe"After"(>) filter.(package private) static final classThe"AnyInteracts"filter.(package private) static final classThe"Before"(<) filter.(package private) static final classThe"Begins"filter.(package private) static final classThe"BegunBy"filter.(package private) static final classThe"TContains"filter.(package private) static final classThe"During"filter.(package private) static final classThe"EndedBy"filter.(package private) static final classThe"Ends"filter.(package private) static final classThe"TEquals"(=) filter.(package private) static final classThe"Meets"filter.(package private) static final classThe"MetBy"filter.(package private) static final classThe"OverlappedBy"filter.(package private) static final classThe"TOverlaps"filter. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longFor cross-version compatibility.Fields inherited from class org.apache.sis.filter.BinaryFunction
expression1, expression2 -
Constructor Summary
ConstructorsConstructorDescriptionTemporalFilter(Expression<? super T, ?> expression1, Expression<? super T, ?> expression2) Creates a new temporal function. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanEvaluates the filter between two instants.protected booleanEvaluates the filter between a period and an instant.protected booleanEvaluates the filter between two periods.private static booleanReturnstrueifselfis non null and afterother.private static booleanReturnstrueifselfis non null and afterother.private static booleanReturnstrueifselfis non null and beforeother.private static booleanReturnstrueifselfis non null and beforeother.private static booleanReturnstrueifselfis non null and equal toother.private static booleanReturnstrueifselfis non null and equal toother.final booleanDetermines if the test(s) represented by this filter passes with the given operands.private static InstantConverts a GeoAPI instant to a Java instant.Methods inherited from class org.apache.sis.filter.BinaryFunction
apply, applyAsDecimal, applyAsDouble, applyAsFraction, applyAsInteger, applyAsLong, getChildren, getExpressions, getParametersMethods inherited from class org.apache.sis.internal.filter.Node
createName, createType, equals, getGeometryLibrary, hashCode, symbol, toGeometryWrapper, toString, unwrap, warningMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sis.filter.Filter
getExpressions, getOperatorType
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor 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
Converts a GeoAPI instant to a Java instant. This is a temporary method to be removed after we revisitedorg.apache.sis.internal.geoapi.temporalpackage.- Parameters:
instant- the GeoAPI instant, ornull.- Returns:
- the Java instant, or
null.
-
isBefore
Returnstrueifselfis non null and beforeother. This is an helper function forevaluate(…)methods implementations. -
isAfter
Returnstrueifselfis non null and afterother. This is an helper function forevaluate(…)methods implementations. -
isEqual
Returnstrueifselfis non null and equal toother. This is an helper function forevaluate(…)methods implementations. -
isBefore
Returnstrueifselfis non null and beforeother. This is an helper function forevaluate(…)methods implementations. -
isAfter
Returnstrueifselfis non null and afterother. This is an helper function forevaluate(…)methods implementations. -
isEqual
Returnstrueifselfis non null and equal toother. This is an helper function forevaluate(…)methods implementations. -
test
Determines if the test(s) represented by this filter passes with the given operands. Values ofBinaryFunction.expression1andBinaryFunction.expression2shall be two single values. -
evaluate
Evaluates the filter between two instants. Both arguments given to this method are non-null. Theselfandotherargument names are chosen to match ISO 19108 tables. -
evaluate
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. Theselfandotherargument names are chosen to match ISO 19108 tables. -
evaluate
Evaluates the filter between two periods. Both arguments given to this method are non-null, but period begin or end instant may be null. Theselfandotherargument names are chosen to match ISO 19108 tables.
-