Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLily Guo2013-05-27 18:34:58 -0400
committerGerrit Code Review @ Eclipse.org2013-06-19 16:21:02 -0400
commit95afdebedf23d9d21d367c66a3b93cab007ec5f9 (patch)
tree85932e518fb8e59c395da299b91e291136ab96e4 /org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal
parent6f0c2e375e7b0322515cd29a4de2e236fe9884ee (diff)
downloadorg.eclipse.mylyn.tasks-95afdebedf23d9d21d367c66a3b93cab007ec5f9.tar.gz
org.eclipse.mylyn.tasks-95afdebedf23d9d21d367c66a3b93cab007ec5f9.tar.xz
org.eclipse.mylyn.tasks-95afdebedf23d9d21d367c66a3b93cab007ec5f9.zip
409758: [api] allow clients to determine the first and last activity
dates of a task Change-Id: I5aa8aa53d204a3c6cef2fc4cfa7d4023f72c719a Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=409758
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java
index b4c77a409..51804d8de 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java
@@ -857,6 +857,22 @@ public class TaskActivityManager implements ITaskActivityManager {
return taskActivationHistory;
}
+ public Date getFirstActivity(ITask task) {
+ SortedMap<Calendar, Long> activityMap = taskElapsedTimeMap.get(task);
+ if (activityMap != null && !activityMap.isEmpty()) {
+ return activityMap.firstKey().getTime();
+ }
+ return null;
+ }
+
+ public Date getLastActivity(ITask task) {
+ SortedMap<Calendar, Long> activityMap = taskElapsedTimeMap.get(task);
+ if (activityMap != null && !activityMap.isEmpty()) {
+ return activityMap.lastKey().getTime();
+ }
+ return null;
+ }
+
public Set<ITask> getAllScheduledTasks() {
return new HashSet<ITask>(allScheduledTasks);
}

Back to the top