net.esper.eql.variable
Class VariableReader

java.lang.Object
  extended by net.esper.eql.variable.VariableReader

public class VariableReader
extends Object

Reads and writes variable values.

Works closely with VariableService in determining the version to read.


Constructor Summary
VariableReader(VariableVersionThreadLocal versionThreadLocal, Class type, String variableName, int variableNumber, VersionedValueList<Object> versions)
          Ctor.
 
Method Summary
 Class getType()
          Returns the type of the variable.
 Object getValue()
          Returns the value of a variable.
 int getVariableNumber()
          Returns the variable number.
 void setVersionsHigh(VersionedValueList<Object> versionsHigh)
          For roll-over (overflow) in version numbers, sets a new collection of versioned-values for the variable to use when requests over the version rollover boundary are made.
 void setVersionsLow(VersionedValueList<Object> versionsLow)
          Sets a new list of versioned-values to inquire against, for use when version numbers roll-over.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableReader

public VariableReader(VariableVersionThreadLocal versionThreadLocal,
                      Class type,
                      String variableName,
                      int variableNumber,
                      VersionedValueList<Object> versions)
Ctor.

Parameters:
versionThreadLocal - service for returning the threads current version of variable
type - is the type of the variable returned
variableName - variable name
variableNumber - number of the variable
versions - a list of versioned-values to ask for the version
Method Detail

getVariableNumber

public int getVariableNumber()
Returns the variable number.

Returns:
variable index number

getType

public Class getType()
Returns the type of the variable.

Returns:
type

setVersionsHigh

public void setVersionsHigh(VersionedValueList<Object> versionsHigh)
For roll-over (overflow) in version numbers, sets a new collection of versioned-values for the variable to use when requests over the version rollover boundary are made.

Parameters:
versionsHigh - the list of versions for roll-over

setVersionsLow

public void setVersionsLow(VersionedValueList<Object> versionsLow)
Sets a new list of versioned-values to inquire against, for use when version numbers roll-over.

Parameters:
versionsLow - the list of versions for read

getValue

public Object getValue()
Returns the value of a variable.

Considers the version set via thread-local for the thread's atomic read of variable values.

Returns:
value of variable at the version applicable for the thead

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com