- java.lang.Object
-
- org.mal_lang.langspec.ttc.TtcExpression
-
- Direct Known Subclasses:
TtcBinaryOperation
,TtcFunction
,TtcNumber
public abstract class TtcExpression extends Object
Immutable class representing a TTC expression in a MAL language.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description TtcExpression()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static TtcExpression
fromJson(JsonObject jsonTtcExpression)
Creates a newTtcExpression
from aJsonObject
.double
getMeanProbability()
Returns the mean probability of thisTtcExpression
object.double
getMeanTtc()
Returns the mean TTC of thisTtcExpression
object.abstract JsonObject
toJson()
Returns the JSON representation of thisTtcExpression
object.
-
-
-
Method Detail
-
getMeanTtc
public double getMeanTtc()
Returns the mean TTC of thisTtcExpression
object.- Returns:
- the mean TTC of this
TtcExpression
object - Throws:
UnsupportedOperationException
- if thisTtcExpression
does not support mean TTC- Since:
- 1.0.0
-
getMeanProbability
public double getMeanProbability()
Returns the mean probability of thisTtcExpression
object.- Returns:
- the mean probability of this
TtcExpression
object - Throws:
UnsupportedOperationException
- if thisTtcExpression
does not support mean probability- Since:
- 1.0.0
-
toJson
public abstract JsonObject toJson()
Returns the JSON representation of thisTtcExpression
object.- Returns:
- the JSON representation of this
TtcExpression
object - Since:
- 1.0.0
-
fromJson
public static TtcExpression fromJson(JsonObject jsonTtcExpression)
Creates a newTtcExpression
from aJsonObject
.- Parameters:
jsonTtcExpression
- theJsonObject
- Returns:
- a new
TtcExpression
- Throws:
NullPointerException
- ifjsonTtcExpression
isnull
- Since:
- 1.0.0
-
-