|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlij.runtime.ClauseInstance
public class ClauseInstance
A ClauseInstance instance is a runtime instance of a Clause definition. It contains the clause definition that is being executed, as well as a SymbolTable instance for storing any variables pertaining to that clause instance. It's main purpose is to decouple the execution code from the model.Clause class
Field Summary | |
---|---|
private Clause |
clause
|
private java.io.Serializable |
id
|
private Interpreter |
interpreter
|
private SymbolTable |
symbolTable
|
Constructor Summary | |
---|---|
ClauseInstance(java.io.Serializable _id,
Clause _clause,
Interpreter _interpreter)
Constructor. |
Method Summary | |
---|---|
java.io.Serializable |
getID()
Accessor. |
java.lang.String |
getKind()
Returns the kind of the current role of this AgentInstance. |
TreeNode |
getRoot()
Convenience method for accessing the root node of the Clause encapsulated in this ClauseInstance. |
SymbolTable |
getSymbolTable()
Accessor. |
Term |
getType()
Accessor. |
java.io.Serializable |
getValueForArgument(Argument argument)
Convenience method for retrieving the value associated with a variable or constant. |
void |
storeVariable(ArgumentVariable variable,
java.io.Serializable value)
Convenience method for storing a variable and its associated value into the SymbolTable of this ClauseInstance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.io.Serializable id
private Clause clause
private SymbolTable symbolTable
private Interpreter interpreter
Constructor Detail |
---|
public ClauseInstance(java.io.Serializable _id, Clause _clause, Interpreter _interpreter)
_id
- The ID of the agent executing this ClauseInstance._clause
- The Clause encapsulated in this ClauseInstance._interpreter
- A reference to the currently running Interpreter instance.Method Detail |
---|
public java.io.Serializable getID()
public Term getType()
public java.lang.String getKind()
public TreeNode getRoot()
public SymbolTable getSymbolTable()
public void storeVariable(ArgumentVariable variable, java.io.Serializable value)
variable
- The variable to store.value
- The value associated with the variable.public java.io.Serializable getValueForArgument(Argument argument) throws InterpreterException
argument
- The Argument whose value will be returned. This can be an ArgumentVariable (in which case the value will be retrieved from the SymbolTable), or an ArgumentConstant (in which case the value returned will be the constant value represented by the ArgumentConstant).
InterpreterException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |