com.atlassian.jira.issue.util
Class AggregateTimeTrackingBean

java.lang.Object
  extended by com.atlassian.jira.issue.util.AggregateTimeTrackingBean

public class AggregateTimeTrackingBean
extends Object

Bean to store values of Time Tracking Aggregate values. It is more efficient to calculate them all at the same time (looping only once), and an instance of this is returned.


Constructor Summary
AggregateTimeTrackingBean(Long originalEstimate, Long remainingEstimate, Long timeSpent, int subtaskCount)
           
 
Method Summary
static Long addAndPreserveNull(Long estValue, Long origValue)
          Method to calculate the addition of two Longs, while preserving null if they are both null.
 void bumpGreatestSubTaskEstimate(Long originalEstimate, Long remainingEstimate, Long timeSpent)
          When this is called, the current values of the bean are used to work out the the greatest sub task estimate.
 Long getGreastestSubTaskEstimate()
          This property is used to track the largest sub task estimate encountered so far.
 Long getOriginalEstimate()
           
 Long getRemainingEstimate()
           
 int getSubTaskCount()
           
static Long getTheGreaterOfEstimates(Long originalEstimate, Long remainingEstimate, Long timeSpent)
          Finds the greater of the original estimate OR the remaining estimate plus the time spent.
 Long getTimeSpent()
           
 void setGreastestSubTaskEstimate(Long greastestSubTaskEstimate)
           
 void setOriginalEstimate(Long originalEstimate)
           
 void setRemainingEstimate(Long remainingEstimate)
           
 void setSubTaskCount(int subtaskCount)
           
 void setTimeSpent(Long timeSpent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateTimeTrackingBean

public AggregateTimeTrackingBean(Long originalEstimate,
                                 Long remainingEstimate,
                                 Long timeSpent,
                                 int subtaskCount)
Method Detail

getTimeSpent

public Long getTimeSpent()

setTimeSpent

public void setTimeSpent(Long timeSpent)

getOriginalEstimate

public Long getOriginalEstimate()

setOriginalEstimate

public void setOriginalEstimate(Long originalEstimate)

getRemainingEstimate

public Long getRemainingEstimate()

setRemainingEstimate

public void setRemainingEstimate(Long remainingEstimate)

getSubTaskCount

public int getSubTaskCount()

setSubTaskCount

public void setSubTaskCount(int subtaskCount)

getGreastestSubTaskEstimate

public Long getGreastestSubTaskEstimate()
This property is used to track the largest sub task estimate encountered so far. Need to help the UI work out how big things should be when it is called piece meal to render the UI. It

Returns:
a Long value which is the greater of the original estimate OR the remaining estimate plus the time spent.

setGreastestSubTaskEstimate

public void setGreastestSubTaskEstimate(Long greastestSubTaskEstimate)

bumpGreatestSubTaskEstimate

public void bumpGreatestSubTaskEstimate(Long originalEstimate,
                                        Long remainingEstimate,
                                        Long timeSpent)
When this is called, the current values of the bean are used to work out the the greatest sub task estimate. TimeSpent is added to remainingEstimate and comapred to teh originalEstimate. The larger is then compared with the beans current greatest estimate and replaces it if greater.

Parameters:
originalEstimate - an issue's original estimate
remainingEstimate - an issue's remaining estimate
timeSpent - an issue time spent

getTheGreaterOfEstimates

public static Long getTheGreaterOfEstimates(Long originalEstimate,
                                            Long remainingEstimate,
                                            Long timeSpent)
Finds the greater of the original estimate OR the remaining estimate plus the time spent.

Parameters:
originalEstimate - original estimate
remainingEstimate - remaining estimate
timeSpent - the time spent
Returns:
the greater of the original estimate OR the remaining estimate plus the time spent.

addAndPreserveNull

public static Long addAndPreserveNull(Long estValue,
                                      Long origValue)
Method to calculate the addition of two Longs, while preserving null if they are both null.

Parameters:
estValue - value from issue
origValue - value from bean
Returns:
new Long based on the addition of the params.


Copyright © 2002-2009 Atlassian. All Rights Reserved.