- java.lang.Object
-
- org.mal_lang.langspec.ttc.TtcExpression
-
- org.mal_lang.langspec.ttc.TtcFunction
-
public final class TtcFunction extends TtcExpression
Immutable class representing a TTC function in a MAL language.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description TtcFunction(TtcDistribution distribution, double... arguments)Constructs a newTtcFunctionobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TtcFunctionfromJson(JsonObject jsonTtcFunction)Creates a newTtcFunctionfrom aJsonObject.double[]getArguments()Returns the arguments of thisTtcFunctionobject.TtcDistributiongetDistribution()Returns the distribution of thisTtcFunctionobject.doublegetMeanProbability()Returns the mean probability of thisTtcExpressionobject.doublegetMeanTtc()Returns the mean TTC of thisTtcExpressionobject.JsonObjecttoJson()Returns the JSON representation of thisTtcExpressionobject.
-
-
-
Constructor Detail
-
TtcFunction
public TtcFunction(TtcDistribution distribution, double... arguments)
Constructs a newTtcFunctionobject.- Parameters:
distribution- the distribution of the functionarguments- the arguments of the function- Throws:
NullPointerException- ifdistributionorargumentsisnullIllegalArgumentException- ifargumentsis not valid fordistribution- Since:
- 1.0.0
-
-
Method Detail
-
getDistribution
public TtcDistribution getDistribution()
Returns the distribution of thisTtcFunctionobject.- Returns:
- the distribution of this
TtcFunctionobject - Since:
- 1.0.0
-
getArguments
public double[] getArguments()
Returns the arguments of thisTtcFunctionobject.- Returns:
- the arguments of this
TtcFunctionobject - Since:
- 1.0.0
-
getMeanTtc
public double getMeanTtc()
Description copied from class:TtcExpressionReturns the mean TTC of thisTtcExpressionobject.- Overrides:
getMeanTtcin classTtcExpression- Returns:
- the mean TTC of this
TtcExpressionobject
-
getMeanProbability
public double getMeanProbability()
Description copied from class:TtcExpressionReturns the mean probability of thisTtcExpressionobject.- Overrides:
getMeanProbabilityin classTtcExpression- Returns:
- the mean probability of this
TtcExpressionobject
-
toJson
public JsonObject toJson()
Description copied from class:TtcExpressionReturns the JSON representation of thisTtcExpressionobject.- Specified by:
toJsonin classTtcExpression- Returns:
- the JSON representation of this
TtcExpressionobject
-
fromJson
public static TtcFunction fromJson(JsonObject jsonTtcFunction)
Creates a newTtcFunctionfrom aJsonObject.- Parameters:
jsonTtcFunction- theJsonObject- Returns:
- a new
TtcFunction - Throws:
NullPointerException- ifjsonTtcFunctionisnull- Since:
- 1.0.0
-
-