Java EE 5 SDK

com.sun.appserv.management.j2ee.statistics
Class MapStatisticImpl

java.lang.Object
  extended by com.sun.appserv.management.j2ee.statistics.MapStatisticImpl
All Implemented Interfaces:
MapStatistic, Serializable, Statistic
Direct Known Subclasses:
CompositeDataStatistic

public class MapStatisticImpl
extends Object
implements MapStatistic, Serializable

Generic implementation of Statistic which contains its members in a Map.

See Also:
Serialized Form

Constructor Summary
MapStatisticImpl(Map<String,?> map)
           
MapStatisticImpl(Statistic statistic)
           
 
Method Summary
 Map<String,Object> asMap()
           
 boolean equals(Object rhs)
           
 String getDescription()
          Get the description for this Statistic
 int getint(String name)
          Get a Statistic value which is expected to be an Integer (int)
 long getLastSampleTime()
          Get the last sample time for this Statistic
 long getlong(String name)
          Get a Statistic value which is expected to be a Long (long)
 String getName()
          Get the name of this Statistic
 long getStartTime()
          Get the start time for this Statistic
 String getString(String name)
          Get a Statistic value which is expected to be a String
 String getUnit()
          Get the units associated with this statistic.
 Object getValue(String name)
          Get a Statistic value which is expected to be any Object
 int hashCode()
           
 String setName(String newName)
          Get the name of this Statistic
 String toString()
           
 Set valueNames()
          Get the fields associated with this statistic.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapStatisticImpl

public MapStatisticImpl(Map<String,?> map)

MapStatisticImpl

public MapStatisticImpl(Statistic statistic)
Method Detail

getlong

public final long getlong(String name)
Get a Statistic value which is expected to be a Long (long)

Specified by:
getlong in interface MapStatistic

getint

public final int getint(String name)
Get a Statistic value which is expected to be an Integer (int)

Specified by:
getint in interface MapStatistic

getString

public final String getString(String name)
Get a Statistic value which is expected to be a String

Specified by:
getString in interface MapStatistic

getValue

public final Object getValue(String name)
Get a Statistic value which is expected to be any Object

Specified by:
getValue in interface MapStatistic

getDescription

public String getDescription()
Get the description for this Statistic

Specified by:
getDescription in interface Statistic

getLastSampleTime

public long getLastSampleTime()
Get the last sample time for this Statistic

Specified by:
getLastSampleTime in interface Statistic

getName

public String getName()
Get the name of this Statistic

Specified by:
getName in interface Statistic

setName

public String setName(String newName)
Get the name of this Statistic

Specified by:
setName in interface MapStatistic

getStartTime

public long getStartTime()
Get the start time for this Statistic

Specified by:
getStartTime in interface Statistic

getUnit

public String getUnit()
Get the units associated with this statistic.

Specified by:
getUnit in interface Statistic

valueNames

public Set valueNames()
Get the fields associated with this statistic. Note the name--"get" is avoided so it won't be introspected as another Statistic field.

Specified by:
valueNames in interface MapStatistic
Returns:
an unmodifiableSet of the field names (String)

asMap

public Map<String,Object> asMap()
Specified by:
asMap in interface MapStatistic

toString

public String toString()
Specified by:
toString in interface MapStatistic
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object rhs)
Overrides:
equals in class Object

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.