public class BoundSymbolObject extends Object implements Cloneable
Modifier and Type | Class and Description |
---|---|
(package private) class |
BoundSymbolObject.Symbols |
Modifier and Type | Field and Description |
---|---|
protected TreeMap<String,BoundSymbolObject> |
children
The child conversations
|
protected String |
name
The name of the conversation
|
private BoundSymbolObject |
parent
The parent conversation
|
protected BoundSymbolObject.Symbols |
symbols
The symbols in this conversation, which may be local bound or may be bound to one of
the parent's symbols (not necessarily of the same name).
|
Constructor and Description |
---|
BoundSymbolObject(String name) |
BoundSymbolObject(String name,
BoundSymbolObject parent) |
Modifier and Type | Method and Description |
---|---|
protected void |
addChild(BoundSymbolObject child)
Add a child to the child conversation list
|
void |
bindValue(String var,
String fromVal,
String toVal)
For the SYMBOL sym, bind the VALUE fromVal to be treated as being equivalent to the VALUE toVal.
|
void |
bindVar(String sym,
Object val)
Create a local binding for this symbol sym.
|
void |
bindVarExpression(String sym,
LispObject exp)
Create a local binding for this symbols sym.
|
void |
bindVarTo(String sym,
String parentSym)
Bind the value of sym to the parent's local
symbol sym.
|
void |
bindVarTo(String sym,
String childName,
String childSym)
Bind the value of childSym in child conversation childName to the local
symbol sym.
|
protected void |
clearChildren() |
BoundSymbolObject |
clone() |
private BoundSymbolObject |
clone(BoundSymbolObject parent) |
protected BoundSymbolObject |
copyTo(BoundSymbolObject x) |
void |
destroy()
Desperate attempt to get the gc to clear objects when we think this one is dead.
|
protected Environment |
extendEnv(Environment env) |
protected BoundSymbolObject |
getChild(String childName) |
Collection<BoundSymbolObject> |
getChildren() |
protected Map<String,LispObject> |
getMap() |
String |
getName() |
protected BoundSymbolObject |
getParent() |
Object |
getVar(String sym)
Resolve the value of symbols sym.
|
void |
setName(String name) |
protected void |
setParent(BoundSymbolObject parent)
Set the parent
|
protected String name
private BoundSymbolObject parent
protected TreeMap<String,BoundSymbolObject> children
protected BoundSymbolObject.Symbols symbols
public BoundSymbolObject(String name)
name
- public BoundSymbolObject(String name, BoundSymbolObject parent)
name
- parent
- protected void setParent(BoundSymbolObject parent)
parent
- protected BoundSymbolObject getParent()
public Collection<BoundSymbolObject> getChildren()
protected void addChild(BoundSymbolObject child)
child
- public void setName(String name)
protected BoundSymbolObject getChild(String childName)
childName
- protected void clearChildren()
public void bindVar(String sym, Object val)
sym
- val
- public void bindVarExpression(String sym, LispObject exp)
sym
- val
- public Object getVar(String sym) throws IllegalOperationException
sym
- IllegalOperationException
- if the sym is not evaluatedpublic void bindVarTo(String sym, String childName, String childSym) throws IllegalOperationException
sym
- childName
- childSym
- IllegalOperationException
- if childName isn't the name of a child of this conversationpublic void bindVarTo(String sym, String parentSym) throws IllegalOperationException
sym
- parentSym
- IllegalOperationException
- if childName isn't the name of a child of this conversationprotected Environment extendEnv(Environment env) throws IllegalOperationException
env
- IllegalOperationException
- if any of the symbols are not evaluated.protected Map<String,LispObject> getMap() throws IllegalOperationException
Lisp.abclEval(TransientAgent, Environment, Map, String, casa.ui.AgentUI)
's Map parameter that represents
the bindings for the BoundSymbols object.IllegalOperationException
- if any of the symbols are not evaluated.public String getName()
public BoundSymbolObject clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
protected BoundSymbolObject copyTo(BoundSymbolObject x) throws CloneNotSupportedException
CloneNotSupportedException
private BoundSymbolObject clone(BoundSymbolObject parent) throws CloneNotSupportedException
CloneNotSupportedException
public void bindValue(String var, String fromVal, String toVal) throws IllegalOperationException
var
- The name of a symbol already registered through #bind(String, Object)
or #bindExp(String, LispObject)
or #bindTo(String, String, String)
.fromVal
- The value to bind.toVal
- The target value.IllegalOperationException
- if the symbol is not found.public void destroy()