public class Duration
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DAY |
static java.lang.String |
HOUR |
static java.lang.String |
MINUTE |
Modifier and Type | Method and Description |
---|---|
Duration |
add(Duration with)
Add the given duration to the current one.
|
static Duration |
create(long durationInMinutes)
Create a Duration from a number of minutes.
|
static Duration |
decode(java.lang.String text,
int hoursInDay)
Create a Duration from a text duration and the number of hours in a day.
|
java.lang.String |
encode(int hoursInDay)
Return the duration in text, by using the given hours in day parameter to process hours.
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isGreaterThan(Duration other)
Return true if the given duration is greater than the current one.
|
Duration |
multiply(int factor)
Multiply the duration with the given factor.
|
Duration |
subtract(Duration with)
Subtract the given duration to the current one.
|
long |
toMinutes()
Return the duration in minutes.
|
java.lang.String |
toString() |
public static final java.lang.String DAY
public static final java.lang.String HOUR
public static final java.lang.String MINUTE
public static Duration create(long durationInMinutes)
public static Duration decode(java.lang.String text, int hoursInDay)
public java.lang.String encode(int hoursInDay)
public long toMinutes()
public boolean isGreaterThan(Duration other)
public Duration multiply(int factor)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object