Package nl.rrd.wool.model.command
Class WoolSetCommand
- java.lang.Object
-
- nl.rrd.wool.model.command.WoolCommand
-
- nl.rrd.wool.model.command.WoolExpressionCommand
-
- nl.rrd.wool.model.command.WoolSetCommand
-
- All Implemented Interfaces:
Cloneable
public class WoolSetCommand extends WoolExpressionCommand
This class models a <<set ...>> command. It can be part of aWoolNodeBody(along with an agent statement) or aWoolReply(to be performed when the user chooses the reply). It contains an assign statement.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class nl.rrd.wool.model.command.WoolExpressionCommand
WoolExpressionCommand.ParseContentResult, WoolExpressionCommand.ReadContentResult
-
-
Constructor Summary
Constructors Constructor Description WoolSetCommand(AssignExpression expression)WoolSetCommand(WoolSetCommand other)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WoolSetCommandclone()Returns a deep copy of this command.voidexecuteBodyCommand(Map<String,Object> variables, WoolNodeBody processedBody)This method is called if this command occurs in a statement body.WoolReplyfindReplyById(int replyId)Tries to find a reply with the specified ID within this command.AssignExpressiongetExpression()voidgetNodePointers(Set<WoolNodePointer> pointers)Retrieves all node pointers that occur in this command and adds them to the specified list.voidgetReadVariableNames(Set<String> varNames)Retrieves all variable names that are read in this command and adds them to the specified set.voidgetWriteVariableNames(Set<String> varNames)Retrieves all variable names that are written in this command and adds them to the specified set.static WoolSetCommandparse(WoolBodyToken cmdStartToken, CurrentIterator<WoolBodyToken> tokens, WoolNodeState nodeState)voidsetExpression(AssignExpression expression)StringtoString()-
Methods inherited from class nl.rrd.wool.model.command.WoolExpressionCommand
parseCommandContent, parseCommandContentExpression, parseCommandContentName, readCommandContent
-
-
-
-
Constructor Detail
-
WoolSetCommand
public WoolSetCommand(AssignExpression expression)
-
WoolSetCommand
public WoolSetCommand(WoolSetCommand other)
-
-
Method Detail
-
getExpression
public AssignExpression getExpression()
-
setExpression
public void setExpression(AssignExpression expression)
-
findReplyById
public WoolReply findReplyById(int replyId)
Description copied from class:WoolCommandTries to find a reply with the specified ID within this command. If no such reply is found, this method returns null.- Specified by:
findReplyByIdin classWoolCommand- Parameters:
replyId- the reply ID- Returns:
- the reply or null
-
getReadVariableNames
public void getReadVariableNames(Set<String> varNames)
Description copied from class:WoolCommandRetrieves all variable names that are read in this command and adds them to the specified set.- Specified by:
getReadVariableNamesin classWoolCommand- Parameters:
varNames- the set to which the variable names are added
-
getWriteVariableNames
public void getWriteVariableNames(Set<String> varNames)
Description copied from class:WoolCommandRetrieves all variable names that are written in this command and adds them to the specified set.- Specified by:
getWriteVariableNamesin classWoolCommand- Parameters:
varNames- the set to which the variable names are added
-
getNodePointers
public void getNodePointers(Set<WoolNodePointer> pointers)
Description copied from class:WoolCommandRetrieves all node pointers that occur in this command and adds them to the specified list.- Specified by:
getNodePointersin classWoolCommand- Parameters:
pointers- the list to which the node pointers are added
-
executeBodyCommand
public void executeBodyCommand(Map<String,Object> variables, WoolNodeBody processedBody) throws EvaluationException
Description copied from class:WoolCommandThis method is called if this command occurs in a statement body. It executes the command with respect to the specified variable map. Any body content that should be sent to the client, is added to "processedBody". This content can be text or client commands, with all variables resolved.- Specified by:
executeBodyCommandin classWoolCommand- Parameters:
variables- the variable mapprocessedBody- the processed body- Throws:
EvaluationException- if an expression cannot be evaluated
-
clone
public WoolSetCommand clone()
Description copied from class:WoolCommandReturns a deep copy of this command.- Specified by:
clonein classWoolCommand- Returns:
- a deep copy of this command
-
parse
public static WoolSetCommand parse(WoolBodyToken cmdStartToken, CurrentIterator<WoolBodyToken> tokens, WoolNodeState nodeState) throws LineNumberParseException
- Throws:
LineNumberParseException
-
-