public class Duration extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
DAY |
static String |
HOUR |
static 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(String text,
int hoursInDay)
Create a Duration from a text duration and the number of hours in a day.
|
String |
encode(int hoursInDay)
Return the duration in text, by using the given hours in day parameter to process hours.
|
boolean |
equals(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.
|
String |
toString() |
public static final String DAY
public static final String HOUR
public static final String MINUTE
public static Duration create(long durationInMinutes)
public static Duration decode(String text, int hoursInDay)
public String encode(int hoursInDay)
public long toMinutes()
public boolean isGreaterThan(Duration other)
Copyright © 2009–2017 SonarSource. All rights reserved.