Methods Summary |
---|
public java.util.Map | asMap()
return( Collections.unmodifiableMap( mItems ) );
|
public boolean | equals(java.lang.Object rhs)
boolean equals = false;
if ( rhs instanceof MapStatistic )
{
equals = MapUtil.mapsEqual( asMap(), ((MapStatistic)rhs).asMap() );
}
return( equals );
|
public java.lang.String | getDescription()Get the description for this Statistic
return( getString( "Description" ) );
|
public long | getLastSampleTime()Get the last sample time for this Statistic
return( getlong( "LastSampleTime" ) );
|
public java.lang.String | getName()Get the name of this Statistic
return( getString( "Name" ) );
|
public long | getStartTime()Get the start time for this Statistic
return( getlong( "StartTime" ) );
|
public final java.lang.String | getString(java.lang.String name)Get a Statistic value which is expected to be a String
return( (String)getValue( name ) );
|
public java.lang.String | getUnit()Get the units associated with this statistic.
return( getString( "Unit" ) );
|
public final java.lang.Object | getValue(java.lang.String name)Get a Statistic value which is expected to be any Object
final Object value = mItems.get( name );
if ( value == null && ! mItems.containsKey( name ) )
{
throw new IllegalArgumentException( name );
}
return( value );
|
public final int | getint(java.lang.String name)Get a Statistic value which is expected to be an Integer (int)
return( ((Integer)getValue( name )).intValue() );
|
public final long | getlong(java.lang.String name)Get a Statistic value which is expected to be a Long (long)
final Object value = getValue( name );
if ( ! (value instanceof Long) )
{
throw new IllegalArgumentException(
"MapStatisticImpl.getLong: expecting Long for " + name +
", got " + value + " of class " + value.getClass() +
", all values: " + toString() );
}
return( ((Long)value).longValue() );
|
public int | hashCode()
return mItems.hashCode();
|
public java.lang.String | setName(java.lang.String newName)Get the name of this Statistic
if ( newName == null || newName.length() == 0 )
{
throw new IllegalArgumentException();
}
final String oldName = getName();
mItems.put( "Name", newName );
return( oldName );
|
public java.lang.String | toString()
return( MapUtil.toString( mItems ) );
|
public java.util.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.
return( Collections.unmodifiableSet( mItems.keySet() ) );
|