Package nz.org.riskscape.engine.function
Class IdentifiedFunction.Wrapping
java.lang.Object
nz.org.riskscape.engine.function.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
FieldsFields inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction
BUILT_IN, LOG
-
Constructor Summary
ConstructorsConstructorDescriptionWrapping
(RiskscapeFunction wrapped, String id, String description, URI sourceURI, IdentifiedFunction.Category category) -
Method Summary
Modifier and TypeMethodDescriptionExecute the function with the given arguments.void
close()
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
getSource, 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, URI sourceURI, 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()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceRiskscapeFunction
-
getId
- Specified by:
getId
in interfaceIdentified
- Returns:
- id
-
getDescription
- Specified by:
getDescription
in interfaceIdentifiedFunction
- Returns:
- a human readable description of the function
-
getSourceURI
- Specified by:
getSourceURI
in interfaceIdentifiedFunction
- Returns:
- a uri indicating the source of function. file/uri etc.
-
getCategory
- Specified by:
getCategory
in interfaceIdentifiedFunction
- Returns:
- the category that this function belongs to
-