com.arsdigita.workflow.simple
Class Duration

java.lang.Object
  extended bycom.arsdigita.workflow.simple.Duration

public class Duration
extends Object

Contains a task's due date and duration information, computed in server locale with millisecond precision. Start date can be set at instatantiation time or later. Duration and due date can be set at any time after instatantiation.

Author:
Stefan Deusch, Khy Huang

Field Summary
static String versionId
           
 
Constructor Summary
Duration(Date startDate)
          Constructor that leaves duration unspecified.
Duration(Date startDate, int minutes)
          Constructor with start date, and duration in minutes.
Duration(Date startDate, int days, int hours, int minutes)
          Constructor with start date, and duration in days, hours, and minutes.
Duration(int minutes)
          Constructor with duration in minutes.
Duration(int days, int hours, int minutes)
          Constructor with duration in days, hours, and minutes.
 
Method Summary
 Date getDueDate()
          Returns the due date.
 int getDuration()
          Returns the number of minutes of the duration.
 Date getStartDate()
          Returns the start date.
 boolean isPassedOverDue()
          Checks if system clock is past the overdue date.
 boolean isPassedOverDue(Date date)
          Checks if a date is past the overdue date.
static void main(String[] arg)
           
 void printSummary(PrintStream out)
          Prints a summary to a java.io.PrintStream.
 void setDuration(int minutes)
          Sets the duration in minutes.
 void setDuration(int days, int hours, int minutes)
          Sets the duration in days, hours, and minutes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

Duration

public Duration(int days,
                int hours,
                int minutes)
Constructor with duration in days, hours, and minutes. Start time is local server time.

Parameters:
days - the number of days
hours - the number of hours
minutes - the number of minutes

Duration

public Duration(int minutes)
Constructor with duration in minutes. Start time is local server time.


Duration

public Duration(Date startDate)
Constructor that leaves duration unspecified. If you use this constructor in a two-step process to determine the duration and the start date, you should call setDuration() later.

Parameters:
startDate - the start date
See Also:
setDuration(int)

Duration

public Duration(Date startDate,
                int days,
                int hours,
                int minutes)
Constructor with start date, and duration in days, hours, and minutes.

Parameters:
startDate - the start date
days - the duration in days
hours - the duration in hours
minutes - the duration in minutes

Duration

public Duration(Date startDate,
                int minutes)
Constructor with start date, and duration in minutes.

Parameters:
startDate - the start date
minutes - the duration in minutes
Method Detail

setDuration

public void setDuration(int days,
                        int hours,
                        int minutes)
Sets the duration in days, hours, and minutes.

Parameters:
days - the duration in days
hours - the duration in hours
minutes - the duration in minutes

setDuration

public void setDuration(int minutes)
Sets the duration in minutes.

Parameters:
minutes - the duration in minutes

getStartDate

public Date getStartDate()
Returns the start date.

Returns:
the start date.

getDueDate

public Date getDueDate()
Returns the due date.

Returns:
the due date.

getDuration

public int getDuration()
Returns the number of minutes of the duration.

Returns:
the duration in minutes.

isPassedOverDue

public boolean isPassedOverDue()
Checks if system clock is past the overdue date.

Returns:
trueif it is past the overdue date; false otherwise.

isPassedOverDue

public boolean isPassedOverDue(Date date)
Checks if a date is past the overdue date. If yes, returns true.

Returns:
trueif the date is past the overdue date; false otherwise.

printSummary

public void printSummary(PrintStream out)
                  throws Exception
Prints a summary to a java.io.PrintStream.

Parameters:
out - the output print stream to print to
Throws:
Exception

main

public static void main(String[] arg)


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC