org.chorem.jtimer.ui.report
Class ReportUtils

java.lang.Object
  extended by org.chorem.jtimer.ui.report.ReportUtils

public class ReportUtils
extends Object

Report utility class for use in freemarker context.

Version:
$Revision: 2607 $ Last update : $Date: 2009-06-18 17:19:19 +0200 (jeu., 18 juin 2009) $ By : $Author: echatellier $
Author:
chatellier

Constructor Summary
ReportUtils()
           
 
Method Summary
 String formatDuration(long duration)
          Format duration in 00:00:00 format.
 List<Date> getDailyDates(Date begin, Date end)
          Get date list, between to date (1 day interval).
 List<String> getDailyTaskAnnotation(TimerTask task, Date day)
          Get task annotations for a day.
 long getDailyTaskTime(TimerTask task, Date day)
          Get task proper time for a day.
 long getDailyTotalTaskTime(TimerTask task, Date day)
          Get task total time (including subtask) for a day.
 List<Date> getMonthlyDates(Date begin, Date end)
          Get date list, between to date (1 month interval).
 List<String> getMonthlyTaskAnnotation(TimerTask task, Date month, Date fromDay, Date toDay)
          Get task annotations for a month.
 long getMonthlyTaskTime(TimerTask task, Date month, Date fromDay, Date toDay)
          Get task proper time for a month.
 long getMonthlyTotalTaskTime(TimerTask task, Date month, Date fromDay, Date toDay)
          Get task total time (including subtask) for a month.
protected  List<Date> getPeriodDates(Date begin, Date end, int calendarField)
          Get date list, between to date.
 List<Date> getWeeklyDates(Date begin, Date end)
          Get date list, between to date (1 week interval).
 List<String> getWeeklyTaskAnnotation(TimerTask task, Date week, Date fromDay, Date toDay)
          Get task annotations for a week.
 long getWeeklyTaskTime(TimerTask task, Date week, Date fromDay, Date toDay)
          Get task proper time for a week.
 long getWeeklyTotalTaskTime(TimerTask task, Date week, Date fromDay, Date toDay)
          Get task total time (including subtask) for a week.
 List<Date> getYearlyDates(Date begin, Date end)
          Get date list, between to date (1 year interval).
 List<String> getYearlyTaskAnnotation(TimerTask task, Date year, Date fromDay, Date toDay)
          Get task annotations for a year.
 long getYearlyTaskTime(TimerTask task, Date year, Date fromDay, Date toDay)
          Get task proper time for a year.
 long getYearlyTotalTaskTime(TimerTask task, Date year, Date fromDay, Date toDay)
          Get task total time (including subtask) for a year.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportUtils

public ReportUtils()
Method Detail

getDailyDates

public List<Date> getDailyDates(Date begin,
                                Date end)
Get date list, between to date (1 day interval).

Parameters:
begin - begin date
end - end date
Returns:
dates list

getWeeklyDates

public List<Date> getWeeklyDates(Date begin,
                                 Date end)
Get date list, between to date (1 week interval).

Parameters:
begin - begin date
end - end date
Returns:
dates list

getMonthlyDates

public List<Date> getMonthlyDates(Date begin,
                                  Date end)
Get date list, between to date (1 month interval).

Parameters:
begin - begin date
end - end date
Returns:
dates list

getYearlyDates

public List<Date> getYearlyDates(Date begin,
                                 Date end)
Get date list, between to date (1 year interval).

Parameters:
begin - begin date
end - end date
Returns:
dates list

getPeriodDates

protected List<Date> getPeriodDates(Date begin,
                                    Date end,
                                    int calendarField)
Get date list, between to date.

Parameters:
begin - begin date
end - end date
calendarField - calendar field to increment
Returns:
dates list

getDailyTaskTime

public long getDailyTaskTime(TimerTask task,
                             Date day)
Get task proper time for a day.

Parameters:
task - task
day - day
Returns:
duration in seconds

getWeeklyTaskTime

public long getWeeklyTaskTime(TimerTask task,
                              Date week,
                              Date fromDay,
                              Date toDay)
Get task proper time for a week. fromDay and toDay allows you to define lower and upper bound in the week week. Thus you can get weekly task time from tuesday to wednesday.

Parameters:
task - task
week - week
fromDay - from day (inclusive)
toDay - to day (inclusive)
Returns:
duration in seconds

getMonthlyTaskTime

public long getMonthlyTaskTime(TimerTask task,
                               Date month,
                               Date fromDay,
                               Date toDay)
Get task proper time for a month. fromDay and toDay allows you to define lower and upper bound in the month month. Thus you can get monthly task time from third day to twelfth day.

Parameters:
task - task
month - month
fromDay - from day (inclusive)
toDay - to day (inclusive)
Returns:
duration in seconds

getYearlyTaskTime

public long getYearlyTaskTime(TimerTask task,
                              Date year,
                              Date fromDay,
                              Date toDay)
Get task proper time for a year. fromDay and toDay allows you to define lower and upper bound in the year year. Thus you can get yearly task time from 03/01 to 31/07.

Parameters:
task - task
year - year
fromDay - from day (inclusive)
toDay - to day (inclusive)
Returns:
duration in seconds

getDailyTotalTaskTime

public long getDailyTotalTaskTime(TimerTask task,
                                  Date day)
Get task total time (including subtask) for a day.

Parameters:
task - task
day - day
Returns:
duration in seconds

getWeeklyTotalTaskTime

public long getWeeklyTotalTaskTime(TimerTask task,
                                   Date week,
                                   Date fromDay,
                                   Date toDay)
Get task total time (including subtask) for a week. fromDay and toDay allows you to define lower and upper bound in the week week. Thus you can get weekly task time from tuesday to wednesday.

Parameters:
task - task
week - week
fromDay - from day (inclusive)
toDay - to day (inclusive)
Returns:
duration in seconds

getMonthlyTotalTaskTime

public long getMonthlyTotalTaskTime(TimerTask task,
                                    Date month,
                                    Date fromDay,
                                    Date toDay)
Get task total time (including subtask) for a month. fromDay and toDay allows you to define lower and upper bound in the month month. Thus you can get monthly task time from third day to twelfth day.

Parameters:
task - task
month - month
fromDay - from day (inclusive)
toDay - to day (inclusive)
Returns:
duration in seconds

getYearlyTotalTaskTime

public long getYearlyTotalTaskTime(TimerTask task,
                                   Date year,
                                   Date fromDay,
                                   Date toDay)
Get task total time (including subtask) for a year. fromDay and toDay allows you to define lower and upper bound in the year year. Thus you can get yearly task time from 03/01 to 31/07.

Parameters:
task - task
year - year
fromDay - from day (inclusive)
toDay - to day (inclusive)
Returns:
duration in seconds

formatDuration

public String formatDuration(long duration)
Format duration in 00:00:00 format.

Parameters:
duration - duration in seconds
Returns:
formated duration

getDailyTaskAnnotation

public List<String> getDailyTaskAnnotation(TimerTask task,
                                           Date day)
Get task annotations for a day.

Parameters:
task - task
day - day
Returns:
annotations of the day

getWeeklyTaskAnnotation

public List<String> getWeeklyTaskAnnotation(TimerTask task,
                                            Date week,
                                            Date fromDay,
                                            Date toDay)
Get task annotations for a week. fromDay and toDay allows you to define lower and upper bound in the week week. Thus you can get weekly task annotations from tuesday to wednesday.

Parameters:
task - task
week - week
fromDay - from day (inclusive)
toDay - to day (inclusive)
Returns:
annotations of the week

getMonthlyTaskAnnotation

public List<String> getMonthlyTaskAnnotation(TimerTask task,
                                             Date month,
                                             Date fromDay,
                                             Date toDay)
Get task annotations for a month. fromDay and toDay allows you to define lower and upper bound in the month month. Thus you can get monthly task annotations from third day to twelfth day.

Parameters:
task - task
month - month
fromDay - from day (inclusive)
toDay - to day (inclusive)
Returns:
annotations of the month

getYearlyTaskAnnotation

public List<String> getYearlyTaskAnnotation(TimerTask task,
                                            Date year,
                                            Date fromDay,
                                            Date toDay)
Get task annotations for a year. fromDay and toDay allows you to define lower and upper bound in the year year. Thus you can get yearly task annotations from 03/01 to 31/07.

Parameters:
task - task
year - year
fromDay - from day (inclusive)
toDay - to day (inclusive)
Returns:
annotations of the year


Copyright © 2007-2010 CodeLutin. All Rights Reserved.