com.atlassian.jira.issue.util
Class AggregateTimeTrackingBean

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

public class AggregateTimeTrackingBean
extends java.lang.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(java.lang.Long originalEstimate, java.lang.Long remainingEstimate, java.lang.Long timeSpent, int subtaskCount)
           
 
Method Summary
static java.lang.Long addAndPreserveNull(java.lang.Long estValue, java.lang.Long origValue)
          Method to calculate the addition of two Longs, while preserving null if they are both null.
 void bumpGreatestSubTaskEstimate(java.lang.Long originalEstimate, java.lang.Long remainingEstimate, java.lang.Long timeSpent)
          When this is called, the current values of the bean are used to work out the the greatest sub task estimate.
 java.lang.Long getGreastestSubTaskEstimate()
          This property is used to track the largest sub task estimate encountered so far.
 java.lang.Long getOriginalEstimate()
           
 java.lang.Long getRemainingEstimate()
           
 int getSubTaskCount()
           
static java.lang.Long getTheGreaterOfEstimates(java.lang.Long originalEstimate, java.lang.Long remainingEstimate, java.lang.Long timeSpent)
          Finds the greater of the original estimate OR the remaining estimate plus the time spent.
 java.lang.Long getTimeSpent()
           
 void setGreastestSubTaskEstimate(java.lang.Long greastestSubTaskEstimate)
           
 void setOriginalEstimate(java.lang.Long originalEstimate)
           
 void setRemainingEstimate(java.lang.Long remainingEstimate)
           
 void setSubTaskCount(int subtaskCount)
           
 void setTimeSpent(java.lang.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(java.lang.Long originalEstimate,
                                 java.lang.Long remainingEstimate,
                                 java.lang.Long timeSpent,
                                 int subtaskCount)
Method Detail

getTimeSpent

public java.lang.Long getTimeSpent()

setTimeSpent

public void setTimeSpent(java.lang.Long timeSpent)

getOriginalEstimate

public java.lang.Long getOriginalEstimate()

setOriginalEstimate

public void setOriginalEstimate(java.lang.Long originalEstimate)

getRemainingEstimate

public java.lang.Long getRemainingEstimate()

setRemainingEstimate

public void setRemainingEstimate(java.lang.Long remainingEstimate)

getSubTaskCount

public int getSubTaskCount()

setSubTaskCount

public void setSubTaskCount(int subtaskCount)

getGreastestSubTaskEstimate

public java.lang.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(java.lang.Long greastestSubTaskEstimate)

bumpGreatestSubTaskEstimate

public void bumpGreatestSubTaskEstimate(java.lang.Long originalEstimate,
                                        java.lang.Long remainingEstimate,
                                        java.lang.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 java.lang.Long getTheGreaterOfEstimates(java.lang.Long originalEstimate,
                                                      java.lang.Long remainingEstimate,
                                                      java.lang.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 java.lang.Long addAndPreserveNull(java.lang.Long estValue,
                                                java.lang.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-2010 Atlassian. All Rights Reserved.