public class WorklogTimeline extends HashMap<String,SortedMap<org.joda.time.DateMidnight,DayWorkHistory>>
Stores the history of work done and remaining estimate, per issue.
Logged work and remaining estimate are different in concept, since logged work is an event at a particular point in time, whereas remaining
estimate is a value that spans time between events (before - after). Since the values stored are just points in time, remaining estimate totals
have to be calculated (see computeTotalRemainingEstimate())
The generic type is intentionally set to TreeMap. First, this is necessary for the correct working of this class. Second, it allows us some
optimisations in navigating the Map.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
WorklogTimeline() |
| Modifier and Type | Method and Description |
|---|---|
long |
computeRemainingEstimate(String issueKey,
org.joda.time.DateMidnight day)
Returns the remaining estimate valid for the given issue on the given day.
|
long |
computeTimeSpentSince(org.joda.time.DateMidnight day)
Compute the cumulative time spent since the given day (inclusive) up to now.
|
long |
computeTotalRemainingEstimate(org.joda.time.DateMidnight day)
Compute the remaining estimate at the end of the given day, for all issues..
|
DayWorkHistory |
getEntryAtDay(String issueKey,
org.joda.time.DateMidnight day)
Return the
DayWorkHistory entry at the given day for the given issue, or null if there is no such entry. |
boolean |
hasEntryAtDay(String issueKey,
org.joda.time.DateMidnight day) |
void |
putEntry(String issueKey,
org.joda.time.DateMidnight day,
DayWorkHistory history)
Add an entry for the given Issue key on the given day.
|
Map<org.joda.time.DateMidnight,List<DayWorkHistory>> |
transpose()
Transpose the map so that the days become the keys and the values are Lists of
DayWorkHistory objects. |
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesequals, hashCode, toStringpublic long computeTotalRemainingEstimate(org.joda.time.DateMidnight day)
day - : the day to compute the estimate for, inclusivepublic long computeRemainingEstimate(String issueKey, org.joda.time.DateMidnight day)
issueKey - : the key of the issue to look forday - : the day to look atpublic long computeTimeSpentSince(org.joda.time.DateMidnight day)
day - : The day to start computingpublic Map<org.joda.time.DateMidnight,List<DayWorkHistory>> transpose()
DayWorkHistory objects. This is useful if log times need
to be calculated by day.public boolean hasEntryAtDay(String issueKey, org.joda.time.DateMidnight day)
public DayWorkHistory getEntryAtDay(String issueKey, org.joda.time.DateMidnight day)
DayWorkHistory entry at the given day for the given issue, or null if there is no such entry.issueKey - : The key of the issueday - : The day to get the entry forpublic void putEntry(String issueKey, org.joda.time.DateMidnight day, DayWorkHistory history)
Copyright © 2007–2015 Atlassian. All rights reserved.