All Packages  This Package  Class Hierarchy  Class Search  Index

Class kh.util.CachingNamedValue
java.lang.Object
   |
   +----java.util.Observable
           |
           +----kh.util.ObservableNamedValue
                   |
                   +----kh.util.CachingNamedValue

  Summary

public class  CachingNamedValue
     extends kh.util.ObservableNamedValue
{
          // Constructors 1
     public CachingNamedValue(Object, NamedValue, long) throws Exception;

          // Methods 2
     protected void finalize();
     public double getValue() throws Exception;
}

This data source maintains a cached copy of some other named value. The cached copy is updated periodically by referring to the master value. This feature is mostly needed for hardware based values which only need to be read occasionally, and have high IO cost for each read.




  Constructors

· CachingNamedValue

Summary  |  Top

   public CachingNamedValue(Object name, 
                            NamedValue sourceValue, 
                            long updatePeriod)  throws Exception

Parameter Description
name the name given to our NamedValue
sourceValue the place we get our values from
updatePeriod the number of ms between updates from the master value



  Methods

· finalize

Summary  |  Top
   protected void finalize() 
Overrides:
finalize in class Object


· getValue

Summary  |  Top
   public double getValue()  throws Exception

Update the value to reflect current reality and return the new value.

Overrides:
getValue in class ObservableNamedValue
Implements:
getValue in interface NamedValue


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7