com.atlassian.jira.project.statistics
Class Statistic

java.lang.Object
  extended bycom.atlassian.jira.project.statistics.Statistic

public class Statistic
extends java.lang.Object

This class is the low level Statistic value. It holds the value for each StatisticType and key within that type


Constructor Summary
Statistic(StatisticType type, StatisticSecurityType statisticSecurityType, java.lang.String key, GenericValue issue)
          This constructor builds a new Statistic object
 
Method Summary
 void addIssue(java.lang.Long issueId)
           
 boolean equals(java.lang.Object o)
           
 java.util.Set getIssueIds()
           
 java.lang.String getKey()
          Returns the key of the Statistic
protected  java.util.Set getRealIssueIds()
           
 java.lang.Object getStatisticSecurityKey()
           
 StatisticSecurityType getStatisticSecurityType()
           
 StatisticType getType()
          Returns the type of the Statistic.
 int hashCode()
           
 boolean hasStatisticSecurityKey(java.lang.Object object)
           
 void merge(Statistic statistic)
          Merges the values of the passed in Statistic with the current object.
 void removeIssue(java.lang.Long issueId)
           
 boolean sameAs(Statistic value)
          Determines if the Statistic passed in is the same as the current object
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Statistic

public Statistic(StatisticType type,
                 StatisticSecurityType statisticSecurityType,
                 java.lang.String key,
                 GenericValue issue)
This constructor builds a new Statistic object

Parameters:
type - The StatisticType that this Statistic is for
key - The key that identifies this Statistic
issue - The Id of an issue
Method Detail

sameAs

public boolean sameAs(Statistic value)
Determines if the Statistic passed in is the same as the current object

If the key and the type are the same then the Statistics are deemed to be the same


merge

public void merge(Statistic statistic)
Merges the values of the passed in Statistic with the current object.

The value of this Statistic will be increased by the amount of the passed in Statistic, while the passed in Statistic will be decreased to zero.

Throws:
java.lang.IllegalArgumentException - if the passed in statistic has a different type or key.

getKey

public java.lang.String getKey()
Returns the key of the Statistic


getType

public StatisticType getType()
Returns the type of the Statistic. This will be a StatisticType


getStatisticSecurityType

public StatisticSecurityType getStatisticSecurityType()

hasStatisticSecurityKey

public boolean hasStatisticSecurityKey(java.lang.Object object)

getStatisticSecurityKey

public java.lang.Object getStatisticSecurityKey()

getRealIssueIds

protected java.util.Set getRealIssueIds()

getIssueIds

public java.util.Set getIssueIds()

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

toString

public java.lang.String toString()

addIssue

public void addIssue(java.lang.Long issueId)
              throws StatisticOutOfDateException
Throws:
StatisticOutOfDateException

removeIssue

public void removeIssue(java.lang.Long issueId)
                 throws StatisticOutOfDateException
Throws:
StatisticOutOfDateException