Deprecated
Replaced by java. implementations such as java. and Period in Java 8.
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"
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private static final int | |
| private static final int | |
| private int | |
| private static final int | |
| private int | |
| private static final int | |
| private boolean | |
| private int | |
| private static final int | |
| private static final long | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | Dur(final int
duration in days days, final int duration in hours hours, final int duration in minutes minutes, final int duration in seconds seconds)Constructs a new duration from the specified arguments. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final Dur | |
| public final int | Returns: a postive value if this duration is longer, zero if the duration lengths are equal, otherwise a negative valueanother duration instance arg0)Implements java.
References Deprecated
Dur is deprecated or references (maybe indirectly) at least one deprecated element.
Compares this duration with another, acording to their length. |
| public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public final int | |
| public final int | |
| public final int | |
| public final Date | |
| public final int | |
| public int | |
| public final boolean | |
| public final Dur | |
| private void | |
| public final String |
| days | back to summary |
|---|---|
| private int days | |
| DAYS_PER_WEEK | back to summary |
|---|---|
| private static final int DAYS_PER_WEEK | |
| DAYS_PER_YEAR | back to summary |
|---|---|
| private static final int DAYS_PER_YEAR | |
| hours | back to summary |
|---|---|
| private int hours | |
| HOURS_PER_DAY | back to summary |
|---|---|
| private static final int HOURS_PER_DAY | |
| minutes | back to summary |
|---|---|
| private int minutes | |
| MINUTES_PER_HOUR | back to summary |
|---|---|
| private static final int MINUTES_PER_HOUR | |
| negative | back to summary |
|---|---|
| private boolean negative | |
| seconds | back to summary |
|---|---|
| private int seconds | |
| SECONDS_PER_MINUTE | back to summary |
|---|---|
| private static final int SECONDS_PER_MINUTE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| weeks | back to summary |
|---|---|
| private int weeks | |
| Dur | back to summary |
|---|---|
| public Dur(final String value) Constructs a new duration instance from a string representation.
| |
| Dur | back to summary |
|---|---|
| public Dur(final int weeks) Constructs a new duration from the specified weeks.
| |
| Dur | back to summary |
|---|---|
| public Dur(final int days, final int hours, final int minutes, final int seconds) Constructs a new duration from the specified arguments.
| |
| Dur | back to summary |
|---|---|
| public Dur(final Date date1, final Date date2) Constructs a new duration representing the time between the two specified dates. The end date may precede the start date in order to represent a negative duration. | |
| add | back to summary |
|---|---|
| public final Dur add(final Dur duration)
References Deprecated
See corresponding docs for further information. Add two durations. Durations may only be added if they are both positive or both negative durations. | |
| compareTo | back to summary |
|---|---|
| public final int compareTo(final Dur arg0) Implements java. References Deprecated
See corresponding docs for further information. Compares this duration with another, acording to their length. | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getDays | back to summary |
|---|---|
public final int getDays()
| |
| getHours | back to summary |
|---|---|
public final int getHours()
| |
| getMinutes | back to summary |
|---|---|
public final int getMinutes()
| |
| getSeconds | back to summary |
|---|---|
public final int getSeconds()
| |
| getTime | back to summary |
|---|---|
| public final Date getTime(final Date start) Returns a date representing the end of this duration from the specified start date. | |
| getWeeks | back to summary |
|---|---|
public final int getWeeks()
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isNegative | back to summary |
|---|---|
public final boolean isNegative()
| |
| negate | back to summary |
|---|---|
| public final Dur negate()
References Deprecated
See corresponding docs for further information. Provides a negation of this instance.
| |
| readObject | back to summary |
|---|---|
| private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException | |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |