TemporalAmount implementations such as Duration and Period in Java 8.@Deprecated public class Dur extends Object implements Comparable<Dur>, Serializable
4.3.6 Duration
Value Name: DURATION
Purpose: This value type is used to identify properties that contain
a duration of time.
Formal Definition: The value type is defined by the following
notation:
dur-value = (["+"] / "-") "P" (dur-date / dur-time / dur-week)
dur-date = dur-day [dur-time]
dur-time = "T" (dur-hour / dur-minute / dur-second)
dur-week = 1*DIGIT "W"
dur-hour = 1*DIGIT "H" [dur-minute]
dur-minute = 1*DIGIT "M" [dur-second]
dur-second = 1*DIGIT "S"
dur-day = 1*DIGIT "D"
| Constructor and Description |
|---|
Dur(Date date1,
Date date2)
Deprecated.
Constructs a new duration representing the time between the two specified dates.
|
Dur(int weeks)
Deprecated.
Constructs a new duration from the specified weeks.
|
Dur(int days,
int hours,
int minutes,
int seconds)
Deprecated.
Constructs a new duration from the specified arguments.
|
Dur(String value)
Deprecated.
Constructs a new duration instance from a string representation.
|
| Modifier and Type | Method and Description |
|---|---|
Dur |
add(Dur duration)
Deprecated.
Add two durations.
|
int |
compareTo(Dur arg0)
Deprecated.
Compares this duration with another, acording to their length.
|
boolean |
equals(Object obj)
Deprecated.
|
int |
getDays()
Deprecated.
|
int |
getHours()
Deprecated.
|
int |
getMinutes()
Deprecated.
|
int |
getSeconds()
Deprecated.
|
Date |
getTime(Date start)
Deprecated.
Returns a date representing the end of this duration from the specified start date.
|
int |
getWeeks()
Deprecated.
|
int |
hashCode()
Deprecated.
|
boolean |
isNegative()
Deprecated.
|
Dur |
negate()
Deprecated.
Provides a negation of this instance.
|
String |
toString()
Deprecated.
|
public Dur(String value)
value - a string representation of a durationpublic Dur(int weeks)
weeks - a duration in weeks.public Dur(int days,
int hours,
int minutes,
int seconds)
days - duration in dayshours - duration in hoursminutes - duration in minutesseconds - duration in secondspublic Dur(Date date1, Date date2)
date1 - the first date of the durationdate2 - the second date of the durationpublic final Date getTime(Date start)
start - the date to start the durationpublic final Dur negate()
public final Dur add(Dur duration)
duration - the duration to add to this durationpublic final int compareTo(Dur arg0)
compareTo in interface Comparable<Dur>arg0 - another duration instancepublic final int getDays()
public final int getHours()
public final int getMinutes()
public final boolean isNegative()
public final int getSeconds()
public final int getWeeks()