Class Scale
java.lang.Object
nz.org.riskscape.engine.function.BaseMathsFunction
nz.org.riskscape.engine.function.maths.Scale
- All Implemented Interfaces:
AutoCloseable
,nz.org.riskscape.engine.function.IdentifiedFunction
,nz.org.riskscape.engine.function.RiskscapeFunction
,nz.org.riskscape.engine.function.UntypedFunction
,nz.org.riskscape.engine.Identified
,nz.org.riskscape.engine.rl.RealizableFunction
public class Scale
extends BaseMathsFunction
implements nz.org.riskscape.engine.function.IdentifiedFunction, nz.org.riskscape.engine.rl.RealizableFunction
Function that will return a scaled version of the first argument by the scale factor in the second argument.
This function is only applicable to numeric Types
s. If the first argument is not numeric or is a
Struct
with no numeric members then the function will not be realized.
In the case of Struct
inputs only numeric members are scaled. Other non-numeric members
are left as is. This included any nested Struct
e.g. any nested structs will not be scaled at all.
-
Nested Class Summary
Nested classes/interfaces inherited from interface nz.org.riskscape.engine.function.IdentifiedFunction
nz.org.riskscape.engine.function.IdentifiedFunction.Category, nz.org.riskscape.engine.function.IdentifiedFunction.Wrapping
Nested classes/interfaces inherited from interface nz.org.riskscape.engine.rl.RealizableFunction
nz.org.riskscape.engine.rl.RealizableFunction.MetadataIdentifiedRealizableFunction
-
Field Summary
Fields inherited from class nz.org.riskscape.engine.function.BaseMathsFunction
description
Fields inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction
BUILT_IN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionnz.org.riskscape.engine.function.ArgumentList
List<nz.org.riskscape.engine.types.Type>
nz.org.riskscape.engine.types.Type
nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.function.RiskscapeFunction>
realize
(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall functionCall, List<nz.org.riskscape.engine.types.Type> argTypes) Methods inherited from class nz.org.riskscape.engine.function.BaseMathsFunction
call, getCategory, getDescription, getId, getSource, wrapping, wrapping, wrapping
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.Identified
getId, getIdentifiedClass
Methods inherited from interface nz.org.riskscape.engine.function.IdentifiedFunction
getCategory, getDescription, getSource, infoOutput, isBuiltin, toEntity
Methods inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction
builtin, getAggregationFunction, getOverloaded, getRealizable, getTypesFromArguments, identified, identified, isA, setProblemReporter, validate
Methods inherited from interface nz.org.riskscape.engine.function.UntypedFunction
call, close
-
Constructor Details
-
Scale
public Scale()
-
-
Method Details
-
realize
public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.function.RiskscapeFunction> realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall functionCall, List<nz.org.riskscape.engine.types.Type> argTypes) - Specified by:
realize
in interfacenz.org.riskscape.engine.rl.RealizableFunction
-
getArguments
public nz.org.riskscape.engine.function.ArgumentList getArguments()- Specified by:
getArguments
in interfacenz.org.riskscape.engine.function.RiskscapeFunction
-
getArgumentTypes
- Specified by:
getArgumentTypes
in interfacenz.org.riskscape.engine.function.RiskscapeFunction
-
getReturnType
public nz.org.riskscape.engine.types.Type getReturnType()- Specified by:
getReturnType
in interfacenz.org.riskscape.engine.function.RiskscapeFunction
-