Package it.unibo.alchemist.model.times
Class DoubleTime
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.Time
,java.io.Serializable
,java.lang.Comparable
public final class DoubleTime implements Time
This class is meant to provide a reasonably fast time implementation. Should be suitable for most usages, but it inherits the problem of the loss of precision of double numbers when comparing big numbers with low numbers. It could become a real problem with long simulations.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Time.Companion
Companion
public final static Time
ZERO
public final static Time
INFINITY
public final static Time
NEGATIVE_INFINITY
-
Constructor Summary
Constructors Constructor Description DoubleTime()
Default empty constructor, builds a DoubleTime with value 0. DoubleTime(double val)
Builds a new DoubleTime starting from the specified value.
-
Method Summary
-
-
Method Detail
-
plus
@Nonnull() DoubleTime plus(Time dt)
-
toDouble
double toDouble()
-
isInfinite
boolean isInfinite()
-
hashCode
int hashCode()
-
-
-
-