|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.atlassian.jira.project.statistics.StatisticCollection
This class is a collection of Statistic
objects for a specific StatisticType
Constructor Summary | |
StatisticCollection(StatisticType type)
Constructor to build a StatisticCollection object |
Method Summary | |
void |
addStatistic(Statistic statistic)
Adds the Statistic to the list of values of the StatisticCollection
|
boolean |
equals(java.lang.Object o)
|
Statistic |
getStatistic(java.lang.String key)
Gets a particlular Statistic from the list by key |
java.util.List |
getStatistics()
Returns a list of Statistic objects contained in the current StatisticCollection object |
StatisticType |
getType()
Returns the StatisticType for this class |
int |
hashCode()
|
void |
merge(StatisticCollection stats)
Adds each of the Statistic objects in the passed in StatisticCollection
object to the current StatisticCollection object and sorts the statistics. |
void |
removeStatistic(Statistic statistic)
Removes a Statistic from the StatisticCollection |
int |
size()
|
void |
sort()
This method will sort this StatisticCollection according to
the comparator of the current StatisticType . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public StatisticCollection(StatisticType type)
StatisticCollection
object
Method Detail |
public void addStatistic(Statistic statistic)
Statistic
to the list of values of the StatisticCollection
It loops through all the Statistic
objects in the current list and if the Statistic
passed in
does not match on that is already there then it is added to the list.
If the Statistic
passed in does match one that is already there in the list then it is merged
merge(StatisticCollection)
public int size()
public java.util.List getStatistics()
Statistic
objects contained in the current StatisticCollection
object
public void sort()
StatisticCollection
according to
the comparator of the current StatisticType
.
public void merge(StatisticCollection stats)
Statistic
objects in the passed in StatisticCollection
object to the current StatisticCollection object and sorts the statistics.
The two StatisticCollection objects must be of the same StatisticType
.
The passed in StatisticCollection will not be altered.
java.lang.IllegalArgumentException
- if the passed in statistic collection has a different statistic type.public StatisticType getType()
StatisticType
for this class
public Statistic getStatistic(java.lang.String key)
If the Statistic doesnt exist then null is returned
public void removeStatistic(Statistic statistic)
Statistic
from the StatisticCollection
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |