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 class
The"After"
(>) filter.(package private) static final class
The"AnyInteracts"
filter.(package private) static final class
The"Before"
(<) filter.(package private) static final class
The"Begins"
filter.(package private) static final class
The"BegunBy"
filter.(package private) static final class
The"TContains"
filter.(package private) static final class
The"During"
filter.(package private) static final class
The"EndedBy"
filter.(package private) static final class
The"Ends"
filter.(package private) static final class
The"TEquals"
(=) filter.(package private) static final class
The"Meets"
filter.(package private) static final class
The"MetBy"
filter.(package private) static final class
The"OverlappedBy"
filter.(package private) static final class
The"TOverlaps"
filter. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
For 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 boolean
Evaluates the filter between two instants.protected boolean
Evaluates the filter between a period and an instant.protected boolean
Evaluates the filter between two periods.private static boolean
Returnstrue
ifself
is non null and afterother
.private static boolean
Returnstrue
ifself
is non null and afterother
.private static boolean
Returnstrue
ifself
is non null and beforeother
.private static boolean
Returnstrue
ifself
is non null and beforeother
.private static boolean
Returnstrue
ifself
is non null and equal toother
.private static boolean
Returnstrue
ifself
is non null and equal toother
.final boolean
Determines if the test(s) represented by this filter passes with the given operands.private static Instant
Converts a GeoAPI instant to a Java instant.Methods inherited from class org.apache.sis.filter.BinaryFunction
apply, applyAsDecimal, applyAsDouble, applyAsFraction, applyAsInteger, applyAsLong, getChildren, getExpressions, getParameters
Methods inherited from class org.apache.sis.internal.filter.Node
createName, createType, equals, getGeometryLibrary, hashCode, symbol, toGeometryWrapper, toString, unwrap, warning
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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.temporal
package.- Parameters:
instant
- the GeoAPI instant, ornull
.- Returns:
- the Java instant, or
null
.
-
isBefore
Returnstrue
ifself
is non null and beforeother
. This is an helper function forevaluate(…)
methods implementations. -
isAfter
Returnstrue
ifself
is non null and afterother
. This is an helper function forevaluate(…)
methods implementations. -
isEqual
Returnstrue
ifself
is non null and equal toother
. This is an helper function forevaluate(…)
methods implementations. -
isBefore
Returnstrue
ifself
is non null and beforeother
. This is an helper function forevaluate(…)
methods implementations. -
isAfter
Returnstrue
ifself
is non null and afterother
. This is an helper function forevaluate(…)
methods implementations. -
isEqual
Returnstrue
ifself
is 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.expression1
andBinaryFunction.expression2
shall be two single values. -
evaluate
Evaluates the filter between two instants. Both arguments given to this method are non-null. Theself
andother
argument 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. Theself
andother
argument 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. Theself
andother
argument names are chosen to match ISO 19108 tables.
-