com.bigdata.counters
Class OneShotInstrument<T>

java.lang.Object
  extended by com.bigdata.counters.OneShotInstrument<T>
Type Parameters:
T -
All Implemented Interfaces:
IInstrument<T>

public class OneShotInstrument<T>
extends Object
implements IInstrument<T>

An Instrument that records a single value at the moment that it is constructed and always reports the same value and lastModified time.

Version:
$Id: OneShotInstrument.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
OneShotInstrument(T value)
           
 
Method Summary
 T getValue()
          Obtain a sample.
 long lastModified()
          Obtain the timestamp for the last collected sample.
 void setValue(T value, long timestamp)
          Set the current value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneShotInstrument

public OneShotInstrument(T value)
Method Detail

getValue

public T getValue()
Description copied from interface: IInstrument
Obtain a sample.

Specified by:
getValue in interface IInstrument<T>

lastModified

public long lastModified()
Description copied from interface: IInstrument
Obtain the timestamp for the last collected sample.

Specified by:
lastModified in interface IInstrument<T>

setValue

public void setValue(T value,
                     long timestamp)
Description copied from interface: IInstrument
Set the current value.

Specified by:
setValue in interface IInstrument<T>
Parameters:
value - The sampled value.
timestamp - The timestamp for that sample.
Throws:
UnsupportedOperationException - always


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.