public class VariableContext extends Object
Constructor and Description |
---|
VariableContext()
Constructor for VariableContext.
|
VariableContext(boolean delegateSets) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsVariable(Object variable)
Check if this context or any of it's parent contexts contain this variable
|
void |
getFlattenedContextMap(Map values)
Helper Methods
|
Object |
getGlobalValue(String variable) |
List<Object> |
getLocalValues() |
VariableContext |
getParentContext()
Get the parent context for this variable context.
|
Object |
getValue(Object variable)
Get the value for the given variable, if the variable exits in the current
context just return the value of the variable else lookup the parent context
and return the value of the variable.
|
Map<Object,Object> |
getVariableMap() |
boolean |
isEmpty()
Check if the current context and its parents contain any variables
|
void |
putAll(VariableContext other) |
Object |
remove(Object symbol) |
void |
setGlobalValue(String variable,
Object value) |
void |
setParentContext(VariableContext parent)
Set the parent variable context for this variable context, when looking up
the variable's value, if the variable is not present in the current context,
the parent context is lookedup.
|
Object |
setValue(Object variable,
Object value)
Set the value for the given, if the variable already exits replaces its value
with the given value else adds a new variable to the map.
|
String |
toString() |
public VariableContext()
public VariableContext(boolean delegateSets)
public Object getGlobalValue(String variable) throws TeiidComponentException
TeiidComponentException
public Object setValue(Object variable, Object value)
variable
- The ElementSymbol
to be added as a variable.value
- The value to be set for the given variable.public Object getValue(Object variable)
variable
- The ElementSymbol
whose value needs to be returned.public void setParentContext(VariableContext parent)
parent
- The parent VariableContext
.public VariableContext getParentContext()
VariableContext
.public void getFlattenedContextMap(Map values)
public boolean containsVariable(Object variable)
variable
- The variable which may be present on this contextpublic boolean isEmpty()
public void clear()
public void putAll(VariableContext other)
Copyright © 2019. All rights reserved.