- java.lang.Object
-
- org.mal_lang.langspec.ttc.TtcExpression
-
- org.mal_lang.langspec.ttc.TtcNumber
-
public final class TtcNumber extends TtcExpression
Immutable class representing a TTC number in a MAL language.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description TtcNumber(double value)
Constructs a newTtcNumber
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TtcNumber
fromJson(JsonObject jsonTtcNumber)
Creates a newTtcNumber
from aJsonObject
.double
getMeanTtc()
Returns the mean TTC of thisTtcExpression
object.double
getValue()
Returns the value of thisTtcNumber
object.JsonObject
toJson()
Returns the JSON representation of thisTtcExpression
object.-
Methods inherited from class org.mal_lang.langspec.ttc.TtcExpression
getMeanProbability
-
-
-
-
Method Detail
-
getValue
public double getValue()
Returns the value of thisTtcNumber
object.- Returns:
- the value of this
TtcNumber
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
-
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 TtcNumber fromJson(JsonObject jsonTtcNumber)
Creates a newTtcNumber
from aJsonObject
.- Parameters:
jsonTtcNumber
- theJsonObject
- Returns:
- a new
TtcNumber
- Throws:
NullPointerException
- ifjsonTtcNumber
isnull
- Since:
- 1.0.0
-
-