com.espertech.esper.epl.variable
Class VariableReader

java.lang.Object
  extended by com.espertech.esper.epl.variable.VariableReader

public class VariableReader
extends java.lang.Object

Reads and writes variable values.

Works closely with VariableService in determining the version to read.


Constructor Summary
VariableReader(VariableVersionThreadLocal versionThreadLocal, java.lang.Class type, EventType eventType, java.lang.String variableName, int variableNumber, VersionedValueList<java.lang.Object> versions, boolean constant)
          Ctor.
 
Method Summary
 EventType getEventType()
          Returns the event type if the variable hold event(s).
 java.lang.Class getType()
          Returns the type of the variable.
 java.lang.Object getValue()
          Returns the value of a variable.
 java.lang.String getVariableName()
          Returns the variable name.
 int getVariableNumber()
          Returns the variable number.
 boolean isConstant()
           
 void setVersionsHigh(VersionedValueList<java.lang.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<java.lang.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,
                      java.lang.Class type,
                      EventType eventType,
                      java.lang.String variableName,
                      int variableNumber,
                      VersionedValueList<java.lang.Object> versions,
                      boolean constant)
Ctor.

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

getVariableName

public java.lang.String getVariableName()
Returns the variable name.

Returns:
variable name

getVariableNumber

public int getVariableNumber()
Returns the variable number.

Returns:
variable index number

getType

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

Returns:
type

setVersionsHigh

public void setVersionsHigh(VersionedValueList<java.lang.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<java.lang.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

getEventType

public EventType getEventType()
Returns the event type if the variable hold event(s).

Returns:
type

getValue

public java.lang.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

isConstant

public boolean isConstant()

© 2006-2014 EsperTech Inc.
All rights reserved.
Visit us at espertech.com