com.atlassian.jira.project.statistics.type
Class AbstractNodeAssocStatisticType

java.lang.Object
  |
  +--com.atlassian.jira.project.statistics.type.AbstractNodeAssocStatisticType
All Implemented Interfaces:
java.util.Comparator, StatisticType
Direct Known Subclasses:
TypeOpenByAffectedVersion, TypeOpenByComponent, TypeOpenByFixVersion

public abstract class AbstractNodeAssocStatisticType
extends java.lang.Object
implements StatisticType

This is an abstract class that contains some common functionality for Node Associated StatisticTypes. Each StatisticType that is Node Associated should extend this class


Field Summary
 
Fields inherited from interface com.atlassian.jira.project.statistics.StatisticType
OPEN_BY_AFFECTED_VERSION, OPEN_BY_ASSIGNEE, OPEN_BY_COMPONENT, OPEN_BY_FIX_VERSION, OPEN_BY_PRIORITY, STATUS
 
Constructor Summary
AbstractNodeAssocStatisticType()
           
 
Method Summary
 void amendCollection(StatisticCollection statisticCollection, StatisticsUpdateEvent event)
          Amends the StatisticCollection dependent on the value of the StatisticsUpdateEvent
 StatisticCollection calculateStatisticsCollection(ProjectStatistics projectStats, org.ofbiz.core.entity.GenericValue securityLevel)
          Calculate the statistics collection for the current StatisticType
 int compare(java.lang.Object o1, java.lang.Object o2)
          Alphatetic Comparator to sort 2 objects alphabetically
protected abstract  boolean doIssueConditionsMeet(org.ofbiz.core.entity.GenericValue issue)
          Checks that any conditions that are placed on the issue for this Statistic Type are met.
 boolean equals(java.lang.Object o)
           
protected abstract  java.util.Collection getAssociatedEntities(org.ofbiz.core.entity.GenericValue project)
          Gets a list of the entities associated with the project.
protected abstract  java.lang.String getAssociationName()
          This is the name of the association between the issue and the entity.
protected abstract  java.lang.String getFieldName()
           
protected abstract  SearchParameter getNullEntityParameter()
          Return a search parameter which will filter out any issues with this entity associated.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractNodeAssocStatisticType

public AbstractNodeAssocStatisticType()
Method Detail

getAssociationName

protected abstract java.lang.String getAssociationName()
This is the name of the association between the issue and the entity.


getFieldName

protected abstract java.lang.String getFieldName()

getAssociatedEntities

protected abstract java.util.Collection getAssociatedEntities(org.ofbiz.core.entity.GenericValue project)
                                                       throws org.ofbiz.core.entity.GenericEntityException
Gets a list of the entities associated with the project.

org.ofbiz.core.entity.GenericEntityException

doIssueConditionsMeet

protected abstract boolean doIssueConditionsMeet(org.ofbiz.core.entity.GenericValue issue)
Checks that any conditions that are placed on the issue for this Statistic Type are met. This should be overridden by sub types. This is used for null entities


calculateStatisticsCollection

public StatisticCollection calculateStatisticsCollection(ProjectStatistics projectStats,
                                                         org.ofbiz.core.entity.GenericValue securityLevel)
Calculate the statistics collection for the current StatisticType

A List of the associated entities for this statistic type are retrieved for the project of the ProjectStatistics object. These associated entities can be components, fix versions etc.

For each of these entities all the issues are retrieved and for every issue that has the same security level and matches the criteria specified in the doIssueConditionsMeet method then 1 is added to the StatisticCollection

Specified by:
calculateStatisticsCollection in interface StatisticType

getNullEntityParameter

protected abstract SearchParameter getNullEntityParameter()
Return a search parameter which will filter out any issues with this entity associated. For example with components, this parameter should return issues with no attached components.


amendCollection

public void amendCollection(StatisticCollection statisticCollection,
                            StatisticsUpdateEvent event)
Amends the StatisticCollection dependent on the value of the StatisticsUpdateEvent

Specified by:
amendCollection in interface StatisticType
See Also:
#amendCollectionForCreate, #amendCollectionForUpdate, #amendCollectionForDelete

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Alphatetic Comparator to sort 2 objects alphabetically

Specified by:
compare in interface java.util.Comparator

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2002-2003 Atlassian. All Rights Reserved.