org.jbpm.cal
Class Duration

java.lang.Object
  extended by 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

Field Summary
protected  int days
           
protected  int hours
           
protected  int millis
           
protected  int minutes
           
protected  int months
           
protected  int seconds
           
protected  int weeks
           
protected  int years
           
 
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)
 
Method Summary
 int getDays()
           
 int getHours()
           
 int getMillis()
           
 int getMinutes()
           
 int getMonths()
           
 int getSeconds()
           
 int getWeeks()
           
 int getYears()
           
 boolean isBusinessTime()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

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)
Method Detail

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()