Class IdentifiedFunction.Wrapping
- All Implemented Interfaces:
AutoCloseable
,IdentifiedFunction
,RiskscapeFunction
,UntypedFunction
,Identified
- Enclosing interface:
- IdentifiedFunction
-
Nested Class Summary
Nested classes/interfaces inherited from interface nz.org.riskscape.engine.function.IdentifiedFunction
IdentifiedFunction.Category, IdentifiedFunction.Wrapping
-
Field Summary
Fields inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction
BUILT_IN
-
Constructor Summary
ConstructorDescriptionWrapping
(RiskscapeFunction wrapped, String id, String description, String source, IdentifiedFunction.Category category) -
Method Summary
Modifier and TypeMethodDescriptionExecute the function with the given arguments.void
close()
Clean up any resources that were allocated with this function.getId()
toString()
validate
(RealizationContext context) Validate that the function can be run.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.Identified
getIdentifiedClass
Methods inherited from interface nz.org.riskscape.engine.function.IdentifiedFunction
infoOutput, isBuiltin, toEntity
Methods inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction
builtin, getTypesFromArguments, identified, identified, isA, setProblemReporter
-
Field Details
-
wrapped
-
-
Constructor Details
-
Wrapping
public Wrapping(RiskscapeFunction wrapped, String id, String description, String source, IdentifiedFunction.Category category)
-
-
Method Details
-
call
Description copied from interface:UntypedFunction
Execute the function with the given arguments.
- Specified by:
call
in interfaceUntypedFunction
- Parameters:
args
- list of arguments to the function that should conform to the types inArgumentList.getArgumentTypes()
-
getArgumentTypes
- Specified by:
getArgumentTypes
in interfaceRiskscapeFunction
- Returns:
- the types that this function expects
-
getArguments
- Specified by:
getArguments
in interfaceRiskscapeFunction
-
getReturnType
- Specified by:
getReturnType
in interfaceRiskscapeFunction
- Returns:
- the type that this function should return
-
getRealizable
- Specified by:
getRealizable
in interfaceRiskscapeFunction
- Returns:
- a
RealizableFunction
that can realize thisRiskscapeFunction
against a type, or empty if this function does not support realization.
-
getOverloaded
- Specified by:
getOverloaded
in interfaceRiskscapeFunction
- Returns:
- an
OverloadedFunction
that offers alternative input types for use within an expression, or empty if this function does not support overloading
-
getAggregationFunction
- Specified by:
getAggregationFunction
in interfaceRiskscapeFunction
- Returns:
- An
AggregationFunction
that is functionally the same operation as this, but works with aRealizedAggregateExpression
, rather than against aRealizedExpression
with anRSList
.
-
validate
Description copied from interface:RiskscapeFunction
Validate that the function can be run.
To be considered valid there should be no
Problem
s found that are at error or fatal. Finding problems of lower severity should not make a function invalid.- Specified by:
validate
in interfaceRiskscapeFunction
- Returns:
- ResultOrProblems indicating if function is valid
-
toString
-
close
public void close()Description copied from interface:UntypedFunction
Clean up any resources that were allocated with this function. This can include large objects, so that any memory used can be reclaimed.
See
Realized
for more information on the life-cycle of executable pipeline objects.Note that there is no standard mechanism for cleaning up resources allocated to functions that realize lambda expressions - the closing of any
RealizedExpression
s or related objects must be done by the function when it's closed. This is probably something that should be addressed once some standard patterns have been established for the implementation of lambda-accepting functions.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceUntypedFunction
-
getId
- Specified by:
getId
in interfaceIdentified
- Returns:
- id
-
getDescription
- Specified by:
getDescription
in interfaceIdentifiedFunction
- Returns:
- a human readable description of the function
-
getSource
- Specified by:
getSource
in interfaceIdentifiedFunction
- Returns:
- a string indicating the source of function. file/uri etc.
-
getCategory
- Specified by:
getCategory
in interfaceIdentifiedFunction
- Returns:
- the category that this function belongs to
-