org.isam.exehda.services.ctxm
Class SingleSensorChainDouble

java.lang.Object
  |
  +--org.isam.exehda.services.ctxm.ContextChain
        |
        +--org.isam.exehda.services.ctxm.SingleSensorChainDouble

class SingleSensorChainDouble
extends ContextChain

A context chain that takes as input double data from a single sensor and translates it into abstract context states according to defined ranges.

Version:
$Date$ $Revision$
Author:
last modified by $Author$

Constructor Summary
SingleSensorChainDouble(java.lang.String ctxdef)
           
 
Method Summary
static ContextChain getInstance(java.lang.String ctxDef)
          Creates a new ContextChain.
static void setChainFactory(ContextChainFactory f)
          Installs a new chain factory.
 ContextEvent updateChain(Environment env, long tsNow)
          Notifies the chain that the current environment has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleSensorChainDouble

public SingleSensorChainDouble(java.lang.String ctxdef)
Method Detail

updateChain

public ContextEvent updateChain(Environment env,
                                long tsNow)
Description copied from class: ContextChain
Notifies the chain that the current environment has changed. The chain should update the current context element state accordingly and return an event in the case it has detected a change in the context element state. If the state of the context element has not changed, null must be returned.

Specified by:
updateChain in class ContextChain
Parameters:
env - an Environment value
tsNow - a time stamp to be used with the generated context event
Returns:
a ContextEvent value or null if the state of the context element has not changed.

setChainFactory

public static void setChainFactory(ContextChainFactory f)
Installs a new chain factory.

Parameters:
f - a non-null ContextChainFactory value

getInstance

public static ContextChain getInstance(java.lang.String ctxDef)
Creates a new ContextChain. This is done by invoking createChain() in the currently configured factory.

Parameters:
ctxDef - a String value
Returns:
a ContextChain value