- 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 newTtcFunction
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TtcFunction
fromJson(JsonObject jsonTtcFunction)
Creates a newTtcFunction
from aJsonObject
.double[]
getArguments()
Returns the arguments of thisTtcFunction
object.TtcDistribution
getDistribution()
Returns the distribution of thisTtcFunction
object.double
getMeanProbability()
Returns the mean probability of thisTtcExpression
object.double
getMeanTtc()
Returns the mean TTC of thisTtcExpression
object.JsonObject
toJson()
Returns the JSON representation of thisTtcExpression
object.
-
-
-
Constructor Detail
-
TtcFunction
public TtcFunction(TtcDistribution distribution, double... arguments)
Constructs a newTtcFunction
object.- Parameters:
distribution
- the distribution of the functionarguments
- the arguments of the function- Throws:
NullPointerException
- ifdistribution
orarguments
isnull
IllegalArgumentException
- ifarguments
is not valid fordistribution
- Since:
- 1.0.0
-
-
Method Detail
-
getDistribution
public TtcDistribution getDistribution()
Returns the distribution of thisTtcFunction
object.- Returns:
- the distribution of this
TtcFunction
object - Since:
- 1.0.0
-
getArguments
public double[] getArguments()
Returns the arguments of thisTtcFunction
object.- Returns:
- the arguments of this
TtcFunction
object - Since:
- 1.0.0
-
getMeanTtc
public double getMeanTtc()
Description copied from class:TtcExpression
Returns the mean TTC of thisTtcExpression
object.- Overrides:
getMeanTtc
in classTtcExpression
- Returns:
- the mean TTC of this
TtcExpression
object
-
getMeanProbability
public double getMeanProbability()
Description copied from class:TtcExpression
Returns the mean probability of thisTtcExpression
object.- Overrides:
getMeanProbability
in classTtcExpression
- Returns:
- the mean probability of this
TtcExpression
object
-
toJson
public JsonObject toJson()
Description copied from class:TtcExpression
Returns the JSON representation of thisTtcExpression
object.- Specified by:
toJson
in classTtcExpression
- Returns:
- the JSON representation of this
TtcExpression
object
-
fromJson
public static TtcFunction fromJson(JsonObject jsonTtcFunction)
Creates a newTtcFunction
from aJsonObject
.- Parameters:
jsonTtcFunction
- theJsonObject
- Returns:
- a new
TtcFunction
- Throws:
NullPointerException
- ifjsonTtcFunction
isnull
- Since:
- 1.0.0
-
-