Package org.pkl.core.runtime
Class VmDuration
- java.lang.Object
-
- org.pkl.core.runtime.VmValue
-
- org.pkl.core.runtime.VmDuration
-
- All Implemented Interfaces:
java.lang.Comparable<VmDuration>
public final class VmDuration extends VmValue implements java.lang.Comparable<VmDuration>
-
-
Constructor Summary
Constructors Constructor Description VmDuration(double value, DurationUnit unit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(VmValueConverter<T> converter, java.lang.Iterable<java.lang.Object> path)voidaccept(VmValueVisitor visitor)VmDurationadd(VmDuration other)intcompareTo(VmDuration other)VmDurationconvertTo(DurationUnit unit)VmDurationdivide(double num)doubledivide(VmDuration other)booleanequals(@Nullable java.lang.Object obj)Enables calling `vmValue.equals()` when not behind a Truffle boundary.Valueexport()voidforce(boolean allowUndefinedValues)Forces recursive (deep) evaluation of this value.DurationUnitgetUnit()doublegetValue()doublegetValue(DurationUnit other)VmClassgetVmClass()inthashCode()VmDurationmultiply(double num)VmDurationpow(double num)VmDurationremainder(double num)VmDurationround()VmDurationsubtract(VmDuration other)java.lang.StringtoString()static @Nullable DurationUnittoUnit(Identifier identifier)-
Methods inherited from class org.pkl.core.runtime.VmValue
export, exportNullable, force, getPrototype, isDynamic, isListing, isMapping, isPrototype, isSequence, isTyped
-
-
-
-
Constructor Detail
-
VmDuration
public VmDuration(double value, DurationUnit unit)
-
-
Method Detail
-
toUnit
public static @Nullable DurationUnit toUnit(Identifier identifier)
-
getVmClass
public VmClass getVmClass()
- Specified by:
getVmClassin classVmValue
-
add
public VmDuration add(VmDuration other)
-
subtract
public VmDuration subtract(VmDuration other)
-
getValue
public double getValue()
-
getValue
public double getValue(DurationUnit other)
-
getUnit
public DurationUnit getUnit()
-
multiply
public VmDuration multiply(double num)
-
divide
public VmDuration divide(double num)
-
divide
public double divide(VmDuration other)
-
remainder
public VmDuration remainder(double num)
-
pow
public VmDuration pow(double num)
-
round
public VmDuration round()
-
convertTo
public VmDuration convertTo(DurationUnit unit)
-
force
public void force(boolean allowUndefinedValues)
Description copied from class:VmValueForces recursive (deep) evaluation of this value.
-
accept
public void accept(VmValueVisitor visitor)
-
accept
public <T> T accept(VmValueConverter<T> converter, java.lang.Iterable<java.lang.Object> path)
-
compareTo
public int compareTo(VmDuration other)
- Specified by:
compareToin interfacejava.lang.Comparable<VmDuration>
-
equals
public boolean equals(@Nullable java.lang.Object obj)
Description copied from class:VmValueEnables calling `vmValue.equals()` when not behind a Truffle boundary.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-