org.jbpm.cal
Class Duration
java.lang.Object
org.jbpm.cal.Duration
- All Implemented Interfaces:
- java.io.Serializable
public class Duration
- extends java.lang.Object
- implements java.io.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. |
|
Duration(boolean isBusinessTime,
int millis,
int seconds,
int minutes,
int hours,
int days,
int weeks,
int months,
int years)
|
|
Duration(java.lang.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 |
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(java.lang.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()