FileDocCategorySizeDatePackage
StatisticToString.javaAPI DocGlassfish v2 API5068Fri May 04 22:25:52 BST 2007com.sun.enterprise.admin.monitor.util

StatisticToString

public final class StatisticToString extends Object
Provides for String representation of all the Statistic classes.
author
Kedar Mhaswade
since
S1AS8.0
version
$Revision: 1.3 $

Fields Summary
private final javax.management.j2ee.statistics.Statistic
stc
private final String
SEP
Constructors Summary
StatisticToString(javax.management.j2ee.statistics.Statistic stc)
Creates a new instance of StatisticToString for given Statistic. Instances of this class are immutable. Note that the returned Strings are basically for debug purposes and should be displayed taking that into account.

param
c Statistic instance that needs its string representation from this class

	                                  		         	 
	  
		this.stc = stc;
	
Methods Summary
private java.lang.StringbaseString()

		final StringBuffer s = new StringBuffer();
		s.append(stc.getName()).append(SEP).append(stc.getUnit()).append(SEP).
		append(stc.getDescription()).append(stc.getStartTime()).append(stc.getStartTime());
		return (s.toString());
	
private java.lang.StringboundedRangeStatisticSpecificString()

		final StringBuffer s = new StringBuffer();
		final BoundedRangeStatistic bs = (BoundedRangeStatistic)stc;
		return ( s.append(bs.getUpperBound()).append(SEP).append(bs.getLowerBound()).toString() );
	
private java.lang.StringcountStatisticSpecificString()

		final StringBuffer s = new StringBuffer();
		final CountStatistic cs = (CountStatistic)stc;
		return ( s.append(cs.getCount()).toString() );
	
private java.lang.StringrangeStatisticSpecificString()

		final StringBuffer s = new StringBuffer();
		final RangeStatistic rs = (RangeStatistic)stc;
		return ( s.append(rs.getLowWaterMark()).append(SEP).append(rs.getHighWaterMark()).toString() );
	
private java.lang.StringspecificString()

		final StringBuffer s = new StringBuffer();
		if (stc instanceof CountStatistic)
			s.append(countStatisticSpecificString());
		if (stc instanceof RangeStatistic)
			s.append(rangeStatisticSpecificString());
		if (stc instanceof BoundedRangeStatistic)
			s.append(boundedRangeStatisticSpecificString());
		if (stc instanceof TimeStatistic)
			s.append(timeStatisticSpecificString());
		return ( s.toString() );
	
private java.lang.StringtimeStatisticSpecificString()

		final StringBuffer s = new StringBuffer();
		final TimeStatistic ts = (TimeStatistic)stc;
		return ( s.append(ts.getMaxTime()).append(SEP).append(ts.getMinTime()).append(SEP).append(ts.getTotalTime()).toString() );
	
public java.lang.StringtoString()

		final StringBuffer s = new StringBuffer();
		return ( s.append(baseString()).append(SEP).append(specificString()).toString() );