FileDocCategorySizeDatePackage
StatisticImpl.javaAPI DocGlassfish v2 API4796Fri May 04 22:30:52 BST 2007com.sun.appserv.management.j2ee.statistics

StatisticImpl

public class StatisticImpl extends Object implements Serializable, javax.management.j2ee.statistics.Statistic
Implementation of Statistic which records its values in member variables.

Fields Summary
static final long
serialVersionUID
private final String
mName
private final String
mDescription
private final String
mUnit
protected long
mLastSampleTime
private final long
mStartTime
Constructors Summary
public StatisticImpl(String name, String description, String unit, long startTime, long lastSampleTime)

	
		
	 
		 	
		 	
		 	
		 		
		 		 
	
		mName	= name;
		mDescription	= description;
		mUnit	= unit;
		mLastSampleTime	= lastSampleTime;
		mStartTime	= startTime;
	
public StatisticImpl(javax.management.j2ee.statistics.Statistic s)

		mName			= s.getName();
		mDescription		= s.getDescription();
		mUnit			= s.getUnit();
		mLastSampleTime	= s.getLastSampleTime();
		mStartTime		= s.getStartTime();
	
Methods Summary
public booleanequals(java.lang.Object rhs)

		boolean	equals	= false;
		
		if ( rhs instanceof Statistic )
		{
			final Statistic	s	= (Statistic)rhs;
			
			equals	= getName().equals( s.getName() ) &&
						getUnit().equals( s.getUnit() ) &&
						getDescription().equals( s.getDescription() ) &&
						getStartTime() == s.getStartTime() &&
						getLastSampleTime() == s.getLastSampleTime();
		}
		return( equals );
	
public java.lang.StringgetDescription()
Get the description for this Statistic

 		return( mDescription );
 	
public longgetLastSampleTime()
Get the last sample time for this Statistic

 		return( mLastSampleTime );
 	
public java.lang.StringgetName()
Get the name of this Statistic

 		return( mName );
	
public longgetStartTime()
Get the start time for this Statistic

 		return( mStartTime );
	
public java.lang.StringgetUnit()
Get the units associated with this statistic.

 		return( mUnit );
	
public inthashCode()

 	    return ObjectUtil.hashCode( mName, mDescription, mUnit) ^
 	            ObjectUtil.hashCode( mLastSampleTime ) ^
 	            ObjectUtil.hashCode( mStartTime );
 	
public java.lang.StringtoString()

		return StatisticStringifier.DEFAULT.stringify( this );