|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.amattioli.encapsulate.dates.PhysicalDuration
public class PhysicalDuration
| Field Summary | |
|---|---|
static PhysicalDuration |
ONE_DAY
|
static PhysicalDuration |
ONE_HOUR
|
static PhysicalDuration |
ONE_MINUTE
|
static PhysicalDuration |
ONE_SECOND
|
static PhysicalDuration |
ONE_WEEK
|
| Constructor Summary | |
|---|---|
PhysicalDuration(Date begin,
Date end)
Constructs a duration given two time points |
|
PhysicalDuration(Day begin,
Day end)
Constructs a duration given two days. |
|
| Method Summary | |
|---|---|
Date |
after(Date begin)
Returns the time point obtained summing this duration to the given time point |
Date |
before(Date begin)
Returns the time point obtained subtracting this duration to the given time point |
int |
compareTo(PhysicalDuration interval)
|
boolean |
equals(Object o)
|
static PhysicalDuration |
fromDays(long days)
Constructs a duration given the number of days. |
static PhysicalDuration |
fromHours(long hours)
Constructs a duration given the hours |
static PhysicalDuration |
fromMilliseconds(long milliseconds)
Constructs a duration given the milliseconds |
static PhysicalDuration |
fromMinutes(long minutes)
Constructs a duration given the minutes |
static PhysicalDuration |
fromSeconds(long seconds)
Constructs a duration given the seconds |
long |
getRemainingHours()
|
long |
getRemainingMilliseconds()
|
long |
getRemainingMinutes()
|
long |
getRemainingSeconds()
|
int |
hashCode()
|
long |
inDays()
Returns this duration in days |
long |
inHours()
Returns this duration in hours |
long |
inMilliseconds()
Returns this duration in milliseconds |
long |
inMinutes()
Returns this duration in minutes |
long |
inSeconds()
Returns this duration in seconds |
Duration |
plus(Duration d)
Add this duration to another to obtain another duration. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final PhysicalDuration ONE_SECOND
public static final PhysicalDuration ONE_MINUTE
public static final PhysicalDuration ONE_HOUR
public static final PhysicalDuration ONE_DAY
public static final PhysicalDuration ONE_WEEK
| Constructor Detail |
|---|
public PhysicalDuration(Date begin,
Date end)
begin - the start time pointend - the end time point
NullPointerException - if at least one of the two parameters is null
public PhysicalDuration(Day begin,
Day end)
begin - the start dayend - the end day
NullPointerException - if at least one of the two parameters is null| Method Detail |
|---|
public static PhysicalDuration fromMilliseconds(long milliseconds)
milliseconds -
public static PhysicalDuration fromSeconds(long seconds)
seconds -
public static PhysicalDuration fromMinutes(long minutes)
minutes -
public static PhysicalDuration fromHours(long hours)
hours -
public static PhysicalDuration fromDays(long days)
days -
public long inMilliseconds()
public long inSeconds()
public long inMinutes()
public long inHours()
public long inDays()
public long getRemainingMilliseconds()
public long getRemainingSeconds()
public long getRemainingMinutes()
public long getRemainingHours()
public Date after(Date begin)
Duration
after in interface Durationpublic Date before(Date begin)
Duration
before in interface Durationpublic Duration plus(Duration d)
Duration
plus in interface Durationpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic int compareTo(PhysicalDuration interval)
compareTo in interface Comparable<PhysicalDuration>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||