|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.fortuna.ical4j.model.Dur
Represents a duration of time in iCalendar. Note that according to RFC2445 durations represented in weeks are mutually exclusive of other duration fields.
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 Summary | |
Dur(Date start,
Date end)
Constructs a new duration representing the time between the two specified dates. |
|
Dur(int weeks)
Constructs a new duration from the specified weeks. |
|
Dur(int days,
int hours,
int minutes,
int seconds)
Constructs a new duration from the specified arguments. |
|
Dur(String value)
Constructs a new duration instance from a string representation. |
Method Summary | |
int |
compareTo(Dur arg0)
Compares this duration with another. |
int |
compareTo(Object arg0)
|
int |
getDays()
|
int |
getHours()
|
int |
getMinutes()
|
int |
getSeconds()
|
Date |
getTime(Date start)
Returns a date representing the end of this duration from the specified start date. |
int |
getWeeks()
|
boolean |
isNegative()
|
Dur |
negate()
Provides a negation of this instance. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
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 start, Date end)
start
- the start date of the durationend
- the end date of the durationMethod Detail |
public final Date getTime(Date start)
start
- the date to start the duration
public final Dur negate()
public final String toString()
public final int compareTo(Object arg0)
compareTo
in interface Comparable
arg0
-
public final int compareTo(Dur arg0)
arg0
-
public final int getDays()
public final int getHours()
public final int getMinutes()
public final boolean isNegative()
public final int getSeconds()
public final int getWeeks()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |