org.chorem.jtimer.entities
Class TimerTaskHelper

java.lang.Object
  extended by org.chorem.jtimer.entities.TimerTaskHelper

public class TimerTaskHelper
extends Object

Helper to remove process code from entity

Version:
$Revision: 2629 $ Last update : $Date: 2009-07-21 18:37:54 +0200 (mar. 21 juil. 2009) $ By : $Author: echatellier $
Author:
chatellier

Constructor Summary
protected TimerTaskHelper()
          Constructor.
 
Method Summary
static long getAllTotalTime(TimerTask task)
          Get total task time including subtasks total time.
static List<String> getAnnotation(TimerTask task, Date date)
          Get all annotations of the day.
static Map<Date,String> getAnnotationMap(TimerTask task, Date date)
          Get all annotations of the day.
static List<TimerTask> getSubTasksOrderedByName(TimerTask task)
          Deprecated. Remove when tree ordering is implemented
static Date getTaskFirstDateOfTiming(TimerTask task)
          Get first date of timing for a task.
static Date getTaskLastDateOfTiming(TimerTask task)
          Get last date of timing for a task.
static List<String> getTaskPath(TimerTask task)
          Build task path.
static TimerProject getTaskProject(TimerTask task)
          Return project associated to a task.
static long getTaskTime(TimerTask task)
          Get total task time without subtasks time.
static long getTotalTime(TimerTask task, Date date)
          Get time for specified date including subtasks time.
static void removeAnnotation(TimerTask task, Date date)
          Remove all annotations of the day.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerTaskHelper

protected TimerTaskHelper()
Constructor.

Method Detail

getSubTasksOrderedByName

public static List<TimerTask> getSubTasksOrderedByName(TimerTask task)
Deprecated. Remove when tree ordering is implemented

Get task's subtasks ordered alphabetically.

Parameters:
task - task
Returns:
the subTasks ordered

getTaskTime

public static long getTaskTime(TimerTask task)
Get total task time without subtasks time.

Parameters:
task - task to get time
Returns:
the alldays task time

getAllTotalTime

public static long getAllTotalTime(TimerTask task)
Get total task time including subtasks total time.

Parameters:
task - task to get time
Returns:
the alldaysTime

getTotalTime

public static long getTotalTime(TimerTask task,
                                Date date)
Get time for specified date including subtasks time.

Parameters:
task - task
date - date for day
Returns:
time in seconds

getTaskFirstDateOfTiming

public static Date getTaskFirstDateOfTiming(TimerTask task)
Get first date of timing for a task.

Parameters:
task - task to find time
Returns:
date

getTaskLastDateOfTiming

public static Date getTaskLastDateOfTiming(TimerTask task)
Get last date of timing for a task.

Parameters:
task - task to find time
Returns:
date

getTaskProject

public static TimerProject getTaskProject(TimerTask task)
Return project associated to a task. Explore recursively all parent.

Parameters:
task - task
Returns:
associated project

getTaskPath

public static List<String> getTaskPath(TimerTask task)
Build task path.

Parameters:
task - task
Returns:
a list containing all ancestor task name (and task itself) ordered by ancestorness.

getAnnotationMap

public static Map<Date,String> getAnnotationMap(TimerTask task,
                                                Date date)
Get all annotations of the day.

Parameters:
date - date
task - the task
Returns:
all annotations of the specified day

getAnnotation

public static List<String> getAnnotation(TimerTask task,
                                         Date date)
Get all annotations of the day.

Parameters:
date - date
task - the task
Returns:
annotation list

removeAnnotation

public static void removeAnnotation(TimerTask task,
                                    Date date)
Remove all annotations of the day.

Parameters:
task - the task
date - date


Copyright © 2007-2009 CodeLutin. All Rights Reserved.