Class DefaultRestrictor
java.lang.Object
nz.org.riskscape.engine.restriction.DefaultRestrictor
- All Implemented Interfaces:
AutoCloseable
,Predicate<Tuple>
,Realized
,Restrictor
-
Constructor Summary
ConstructorDescriptionDefaultRestrictor
(Struct sourceType, Predicate<Tuple> predicate) DefaultRestrictor
(Struct sourceType, Predicate<Tuple> predicate, Runnable closeFunction) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Clean up any resources allocated to thisRealized
thing.The exactStruct
that Tuple's passed toPredicate.test(java.lang.Object)
should be of.boolean
-
Constructor Details
-
DefaultRestrictor
-
DefaultRestrictor
-
-
Method Details
-
test
-
close
public void close()Description copied from interface:Realized
Clean up any resources allocated to this
Realized
thing. This might involve removing temporary files, closing or flushing a network connection to some external service, or terminating some child processes. Note that it's expected that this object won't be used again after being closed.In some instances, implementations may want to remove references to large (in terms of memory) objects so that they can be garbage collected even if references to the pipeline continue to keep them 'live' in the JVM's object graph
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceRealized
-
getSourceType
Description copied from interface:Restrictor
The exact
Struct
that Tuple's passed toPredicate.test(java.lang.Object)
should be of.- Specified by:
getSourceType
in interfaceRestrictor
-
getPredicate
-