com.espertech.esper.core.service
Class StatementVariableRefImpl

java.lang.Object
  extended by com.espertech.esper.core.service.StatementVariableRefImpl
All Implemented Interfaces:
StatementVariableRef

public class StatementVariableRefImpl
extends java.lang.Object
implements StatementVariableRef

Service for holding references between statements and their variable use.


Constructor Summary
StatementVariableRefImpl(VariableService variableService)
          Ctor.
 
Method Summary
 void addConfiguredVariable(java.lang.String variableName)
          Add a preconfigured variable.
 void addReferences(java.lang.String statementName, java.util.Set<java.lang.String> variablesReferenced)
          Add a reference from a statement name to a set of variables.
 java.util.Set<java.lang.String> getStatementNamesForVar(java.lang.String variableName)
          Returns the set of statement names that use a given variable.
protected  java.util.HashMap<java.lang.String,java.util.Set<java.lang.String>> getStmtToVariable()
          For testing, returns the mapping of statement names to variable names.
protected  java.util.HashMap<java.lang.String,java.util.Set<java.lang.String>> getVariableToStmt()
          For testing, returns the mapping of variable name to statement names.
 boolean isInUse(java.lang.String variable)
          Returns true if the variable is listed as in-use by any statement, or false if not
 void removeConfiguredVariable(java.lang.String variableName)
          Remove a preconfigured variable.
 void removeReferencesStatement(java.lang.String statementName)
          Remove all references for a given statement.
 void removeReferencesVariable(java.lang.String name)
          Remove all references for a given event type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatementVariableRefImpl

public StatementVariableRefImpl(VariableService variableService)
Ctor.

Parameters:
variableService - variables
Method Detail

addConfiguredVariable

public void addConfiguredVariable(java.lang.String variableName)
Description copied from interface: StatementVariableRef
Add a preconfigured variable.

Specified by:
addConfiguredVariable in interface StatementVariableRef
Parameters:
variableName - name

removeConfiguredVariable

public void removeConfiguredVariable(java.lang.String variableName)
Description copied from interface: StatementVariableRef
Remove a preconfigured variable.

Specified by:
removeConfiguredVariable in interface StatementVariableRef
Parameters:
variableName - var

addReferences

public void addReferences(java.lang.String statementName,
                          java.util.Set<java.lang.String> variablesReferenced)
Description copied from interface: StatementVariableRef
Add a reference from a statement name to a set of variables.

Specified by:
addReferences in interface StatementVariableRef
Parameters:
statementName - name of statement
variablesReferenced - types

removeReferencesStatement

public void removeReferencesStatement(java.lang.String statementName)
Description copied from interface: StatementVariableRef
Remove all references for a given statement.

Specified by:
removeReferencesStatement in interface StatementVariableRef
Parameters:
statementName - statement name

removeReferencesVariable

public void removeReferencesVariable(java.lang.String name)
Description copied from interface: StatementVariableRef
Remove all references for a given event type.

Specified by:
removeReferencesVariable in interface StatementVariableRef
Parameters:
name - variable name

isInUse

public boolean isInUse(java.lang.String variable)
Description copied from interface: StatementVariableRef
Returns true if the variable is listed as in-use by any statement, or false if not

Specified by:
isInUse in interface StatementVariableRef
Parameters:
variable - name
Returns:
indicator whether variable is in use

getStatementNamesForVar

public java.util.Set<java.lang.String> getStatementNamesForVar(java.lang.String variableName)
Description copied from interface: StatementVariableRef
Returns the set of statement names that use a given variable.

Specified by:
getStatementNamesForVar in interface StatementVariableRef
Parameters:
variableName - name
Returns:
set of statements or null if none found

getVariableToStmt

protected java.util.HashMap<java.lang.String,java.util.Set<java.lang.String>> getVariableToStmt()
For testing, returns the mapping of variable name to statement names.

Returns:
mapping

getStmtToVariable

protected java.util.HashMap<java.lang.String,java.util.Set<java.lang.String>> getStmtToVariable()
For testing, returns the mapping of statement names to variable names.

Returns:
mapping

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