org.dspace.app.statistics
Class Stat

java.lang.Object
  extended by org.dspace.app.statistics.Stat
All Implemented Interfaces:
Comparable

public class Stat
extends Object
implements Comparable

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
 int compareTo(Object o)
          compare the current object to the given object returning -1 if o is less than the current object, 0 if they are the same, and +1 if o is greater than the current object.
 String getKey()
          get the key (text describing) the statistic
 String getReference()
          get the reference to related statistic information
 String getUnits()
          get the unts that this statistic is measured in
 int getValue()
          get the value of the statistic
 void setKey(String key)
          set the reference information
 void setReference(String reference)
          set the reference information
 void setUnits(String unit)
          set the units of this statistic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setUnits

public void setUnits(String unit)
set the units of this statistic

Parameters:
unit - the units that this statistic is measured in

getUnits

public String 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

public String getKey()
get the key (text describing) the statistic

Returns:
the key for this statistic

getReference

public String getReference()
get the reference to related statistic information

Returns:
the reference for this statistic

setKey

public void setKey(String key)
set the reference information

Parameters:
key - the key for this statistic

setReference

public void setReference(String reference)
set the reference information

Parameters:
reference - the reference for this statistic

compareTo

public int compareTo(Object o)
compare the current object to the given object returning -1 if o is less than the current object, 0 if they are the same, and +1 if o is greater than the current object.

Specified by:
compareTo in interface Comparable
Parameters:
o - the 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.


Copyright © 2010 DuraSpace. All Rights Reserved.