xsmeral.pipe.stats
Class Stats.Reader

java.lang.Object
  extended by xsmeral.pipe.stats.Stats.Reader
All Implemented Interfaces:
StatsReader
Enclosing class:
Stats

public static class Stats.Reader
extends Object
implements StatsReader

The main implementation of StatsReader. Provides methods for reading and conversion of stat values stored in processing context. The methods automatically convert values, i.e. an int can be accessed with getDouble and vice versa.


Method Summary
 Double getDouble(String fullStatName)
          Returns value of the context parameter with the supplied name as a Double.
 Double getDouble(String group, String stat)
          Returns value of the statistic specified by group and name as a Double.
 Long getLong(String fullStatName)
          Returns value of the context parameter with the supplied name as a Long.
 Long getLong(String group, String stat)
          Returns value of the statistic specified by group and name as a Long.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDouble

public Double getDouble(String fullStatName)
Returns value of the context parameter with the supplied name as a Double. Automatically casts to output type.

Specified by:
getDouble in interface StatsReader
Parameters:
fullStatName - Full name of the context parameter
Returns:
The value as Double, or null if no such parameter exists or its value is not a Number.

getDouble

public Double getDouble(String group,
                        String stat)
Returns value of the statistic specified by group and name as a Double. Automatically casts to output type.

Specified by:
getDouble in interface StatsReader
Parameters:
group - Group name
stat - Stat name
Returns:
The value as Double, or null if no such parameter exists or its value is not a Number.

getLong

public Long getLong(String fullStatName)
Returns value of the context parameter with the supplied name as a Long. Automatically casts to output type.

Specified by:
getLong in interface StatsReader
Parameters:
fullStatName - Full name of the context parameter
Returns:
The value as Long, or null if no such parameter exists or its value is not a Number.

getLong

public Long getLong(String group,
                    String stat)
Returns value of the statistic specified by group and name as a Long. Automatically casts to output type.

Specified by:
getLong in interface StatsReader
Parameters:
group - Group name
stat - Stat name
Returns:
The value as Long, or null if no such parameter exists or its value is not a Number.