com.neeve.stats
Class MethodReflectingGauge

java.lang.Object
  extended by com.neeve.stats.AbstractGauge
      extended by com.neeve.stats.MethodReflectingGauge
All Implemented Interfaces:
IStats.Gauge

public class MethodReflectingGauge
extends AbstractGauge

A Gauge that gets its value by reflecting on a Method


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.neeve.stats.IStats.Gauge
IStats.Gauge.Type
 
Constructor Summary
MethodReflectingGauge(String name, Object target, Method accessor)
           
 
Method Summary
 void get(StringBuilder builder, NumberFormat format)
          Appends the current value of this IStats.Gauge.
 boolean getBooleanValue()
          Gets the current value for a IStats.Gauge.Type.Boolean Gauge.
 byte getByteValue()
          Gets the current value for a IStats.Gauge.Type.Byte Gauge.
 char getCharValue()
          Gets the current value for a IStats.Gauge.Type.Char Gauge.
 double getDoubleValue()
          Gets the current value for a IStats.Gauge.Type.Double Gauge.
 float getFloatValue()
          Gets the current value for a IStats.Gauge.Type.Float Gauge.
 int getIntValue()
          Gets the current value for a IStats.Gauge.Type.Int Gauge.
 long getLongValue()
          Gets the current value for a IStats.Gauge.Type.Long Gauge.
 short getShortValue()
          Gets the current value for a IStats.Gauge.Type.Short Gauge.
 XString getStringValue()
          Gets the current value for a IStats.Gauge.Type.String Gauge.
 
Methods inherited from class com.neeve.stats.AbstractGauge
getName, getNameAsRaw, getType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodReflectingGauge

public MethodReflectingGauge(String name,
                             Object target,
                             Method accessor)
Method Detail

getBooleanValue

public final boolean getBooleanValue()
Description copied from interface: IStats.Gauge
Gets the current value for a IStats.Gauge.Type.Boolean Gauge.

Specified by:
getBooleanValue in interface IStats.Gauge
Overrides:
getBooleanValue in class AbstractGauge
Returns:
The current value for a IStats.Gauge.Type.Boolean Gauge.

getByteValue

public final byte getByteValue()
Description copied from interface: IStats.Gauge
Gets the current value for a IStats.Gauge.Type.Byte Gauge.

Specified by:
getByteValue in interface IStats.Gauge
Overrides:
getByteValue in class AbstractGauge
Returns:
The current value for a IStats.Gauge.Type.Byte Gauge.

getCharValue

public final char getCharValue()
Description copied from interface: IStats.Gauge
Gets the current value for a IStats.Gauge.Type.Char Gauge.

Specified by:
getCharValue in interface IStats.Gauge
Overrides:
getCharValue in class AbstractGauge
Returns:
The current value for a IStats.Gauge.Type.Char Gauge.

getShortValue

public final short getShortValue()
Description copied from interface: IStats.Gauge
Gets the current value for a IStats.Gauge.Type.Short Gauge.

Specified by:
getShortValue in interface IStats.Gauge
Overrides:
getShortValue in class AbstractGauge
Returns:
The current value for a IStats.Gauge.Type.Short Gauge.

getIntValue

public final int getIntValue()
Description copied from interface: IStats.Gauge
Gets the current value for a IStats.Gauge.Type.Int Gauge.

Specified by:
getIntValue in interface IStats.Gauge
Overrides:
getIntValue in class AbstractGauge
Returns:
The current value for a IStats.Gauge.Type.Int Gauge.

getLongValue

public final long getLongValue()
Description copied from interface: IStats.Gauge
Gets the current value for a IStats.Gauge.Type.Long Gauge.

Specified by:
getLongValue in interface IStats.Gauge
Overrides:
getLongValue in class AbstractGauge
Returns:
The current value for a IStats.Gauge.Type.Long Gauge.

getFloatValue

public final float getFloatValue()
Description copied from interface: IStats.Gauge
Gets the current value for a IStats.Gauge.Type.Float Gauge.

Specified by:
getFloatValue in interface IStats.Gauge
Overrides:
getFloatValue in class AbstractGauge
Returns:
The current value for a IStats.Gauge.Type.Float Gauge.

getDoubleValue

public final double getDoubleValue()
Description copied from interface: IStats.Gauge
Gets the current value for a IStats.Gauge.Type.Double Gauge.

Specified by:
getDoubleValue in interface IStats.Gauge
Overrides:
getDoubleValue in class AbstractGauge
Returns:
The current value for a IStats.Gauge.Type.Double Gauge.

getStringValue

public final XString getStringValue()
Description copied from interface: IStats.Gauge
Gets the current value for a IStats.Gauge.Type.String Gauge.

Specified by:
getStringValue in interface IStats.Gauge
Overrides:
getStringValue in class AbstractGauge
Returns:
The current value for a IStats.Gauge.Type.String Gauge.

get

public final void get(StringBuilder builder,
                      NumberFormat format)
Description copied from interface: IStats.Gauge
Appends the current value of this IStats.Gauge. to the provided StringBuilder.

Specified by:
get in interface IStats.Gauge
Overrides:
get in class AbstractGauge
Parameters:
builder - The builder to which to append the gauge value results.
format - The number format to use for numeric formats.


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.