Package de.dlr.proseo.model
Klasse SimplePolicy.DeltaTime
java.lang.Object
de.dlr.proseo.model.SimplePolicy.DeltaTime
- Alle implementierten Schnittstellen:
Comparable<SimplePolicy.DeltaTime>
- Umschließende Klasse:
SimplePolicy
@Embeddable
public static class SimplePolicy.DeltaTime
extends Object
implements Comparable<SimplePolicy.DeltaTime>
Class representing a single overlapping time period
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungint
boolean
int
hashCode()
merge
(SimplePolicy.DeltaTime anotherDeltaTime) Merge two delta times by creating a new delta time with the smaller unit and the larger (converted) durationNormalize delta time to biggest unit, which can be represented with an integer durationlong
Convert the delta time to millisecondslong
Convert the delta time to seconds (rounded to the nearest second)toString()
-
Felddetails
-
duration
public long durationThe duration of the time period in time units (non-negative) -
unit
The time unit applicable for this time period
-
-
Konstruktordetails
-
DeltaTime
public DeltaTime()No-argument constructor sets delta time to zero days -
DeltaTime
Create a delta time with duration and unit- Parameter:
duration
- the delta time durationunit
- the delta time unit
-
-
Methodendetails
-
merge
Merge two delta times by creating a new delta time with the smaller unit and the larger (converted) duration- Parameter:
anotherDeltaTime
- the delta time to merge this one with- Gibt zurück:
- a new DeltaTime object with the larger duration
-
toSeconds
public long toSeconds()Convert the delta time to seconds (rounded to the nearest second)- Gibt zurück:
- the duration of the delta time in seconds
-
toMilliseconds
public long toMilliseconds()Convert the delta time to milliseconds- Gibt zurück:
- the duration of the delta time in milliseconds
-
normalize
Normalize delta time to biggest unit, which can be represented with an integer duration- Gibt zurück:
- the delta time itself for method chaining
-
toString
-
hashCode
public int hashCode() -
equals
-
compareTo
- Angegeben von:
compareTo
in SchnittstelleComparable<SimplePolicy.DeltaTime>
-