org.ow2.orchestra.pvm.internal.cal
Class Duration
java.lang.Object
org.ow2.orchestra.pvm.internal.cal.Duration
- All Implemented Interfaces:
- Serializable
public class Duration
- extends Object
- implements Serializable
represents a time duration.
With the constructor {link Duration(String) you can create a
Duration from a text representation. The syntax is as follows
duration = part [',' part | 'and' part]*
part = number ['business'] unit
number = (0..9)+
unit = (y|year|years|month|months|w|week|weeks|d|day|days|h|hour|hours|min|minute|minutes|s|sec|second|seconds|milli|millis|millisecond|milliseconds)
Duration is immutable.
- See Also:
- Serialized Form
|
Constructor Summary |
protected |
Duration()
constructor for persistence. note that this type is to be immutable. |
|
Duration(boolean isBusinessTime,
int millis,
int seconds,
int minutes,
int hours,
int days,
int weeks,
int months,
int years)
|
|
Duration(String text)
parses the duration from a text
duration = part [',' part | 'and' part]* part = number ['business'] unit
number = (0..9)+ unit =
(y|year|years|month|months|w|week|weeks|d|day|days|h
|hour|hours|min|minute|minutes
|s|sec|second|seconds|milli|millis|millisecond|milliseconds) |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
isBusinessTime
protected boolean isBusinessTime
millis
protected int millis
seconds
protected int seconds
minutes
protected int minutes
hours
protected int hours
days
protected int days
weeks
protected int weeks
months
protected int months
years
protected int years
Duration
protected Duration()
- constructor for persistence. note that this type is to be immutable.
Duration
public Duration(String text)
- parses the duration from a text
duration = part [',' part | 'and' part]* part = number ['business'] unit
number = (0..9)+ unit =
(y|year|years|month|months|w|week|weeks|d|day|days|h
|hour|hours|min|minute|minutes
|s|sec|second|seconds|milli|millis|millisecond|milliseconds)
- Throws:
PvmException - if the parsing is unsuccessful
Duration
public Duration(boolean isBusinessTime,
int millis,
int seconds,
int minutes,
int hours,
int days,
int weeks,
int months,
int years)
getDays
public int getDays()
getHours
public int getHours()
isBusinessTime
public boolean isBusinessTime()
getMillis
public int getMillis()
getMinutes
public int getMinutes()
getMonths
public int getMonths()
getSeconds
public int getSeconds()
getWeeks
public int getWeeks()
getYears
public int getYears()
Copyright © 2011 OW2 Consortium. All Rights Reserved.