Package org.dspace.app.statistics
Class Stat
java.lang.Object
org.dspace.app.statistics.Stat
- All Implemented Interfaces:
Comparable<Stat>
This is a primitive class to represent a single statistic, which will
generally be a key value pair but with the capabilities for being sorted
Note: this class has a natural ordering that is inconsistent with equals
- Author:
- Richard Jones
-
Method Summary
Modifier and TypeMethodDescriptionintCompare the current Stat to the given Stat returning -1 if o is less than the current Stat, 0 if they are the same, and +1 if o is greater than the current Stat.getKey()get the key (text describing) the statisticget the reference to related statistic informationgetUnits()get the unts that this statistic is measured inintgetValue()get the value of the statisticvoidset the reference informationvoidsetReference(String reference) set the reference informationvoidset the units of this statistic
-
Method Details
-
setUnits
set the units of this statistic- Parameters:
unit- the units that this statistic is measured in
-
getUnits
get the unts that this statistic is measured in- Returns:
- the units this statistic is measured in
-
getValue
public int getValue()get the value of the statistic- Returns:
- the value of this statistic
-
getKey
get the key (text describing) the statistic- Returns:
- the key for this statistic
-
getReference
get the reference to related statistic information- Returns:
- the reference for this statistic
-
setKey
set the reference information- Parameters:
key- the key for this statistic
-
setReference
set the reference information- Parameters:
reference- the reference for this statistic
-
compareTo
Compare the current Stat to the given Stat returning -1 if o is less than the current Stat, 0 if they are the same, and +1 if o is greater than the current Stat.- Specified by:
compareToin interfaceComparable<Stat>- Parameters:
stat- the Stat object to compare to the current one- Returns:
- +1, 0, -1 if o is less than, equal to, or greater than the current object value.
-