Class DefaultRestrictor
java.lang.Object
nz.org.riskscape.engine.restriction.DefaultRestrictor
- All Implemented Interfaces:
AutoCloseable,Predicate<Tuple>,Realized,Restrictor
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultRestrictor(Struct sourceType, Predicate<Tuple> predicate) DefaultRestrictor(Struct sourceType, Predicate<Tuple> predicate, Runnable closeFunction) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Clean up any resources allocated to thisRealizedthing.The exactStructthat Tuple's passed toPredicate.test(java.lang.Object)should be of.booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nz.org.riskscape.engine.restriction.Restrictor
getProducedType
-
Constructor Details
-
DefaultRestrictor
-
DefaultRestrictor
-
-
Method Details
-
test
-
close
public void close()Description copied from interface:RealizedClean up any resources allocated to this
Realizedthing. 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceRealized
-
getSourceType
Description copied from interface:RestrictorThe exact
Structthat Tuple's passed toPredicate.test(java.lang.Object)should be of.- Specified by:
getSourceTypein interfaceRestrictor
-
getPredicate
-