Package nl.rrd.wool.model.command
Class WoolInputNumericCommand
- java.lang.Object
-
- nl.rrd.wool.model.command.WoolCommand
-
- nl.rrd.wool.model.command.WoolAttributesCommand
-
- nl.rrd.wool.model.command.WoolInputCommand
-
- nl.rrd.wool.model.command.WoolInputNumericCommand
-
- All Implemented Interfaces:
Cloneable
public class WoolInputNumericCommand extends WoolInputCommand
-
-
Field Summary
-
Fields inherited from class nl.rrd.wool.model.command.WoolInputCommand
TYPE_NUMERIC, TYPE_SET, TYPE_TEXT, TYPE_TIME
-
-
Constructor Summary
Constructors Constructor Description WoolInputNumericCommand(String variableName)WoolInputNumericCommand(WoolInputNumericCommand other)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WoolInputNumericCommandclone()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.IntegergetMax()IntegergetMin()Map<String,?>getParameters()Returns the parameters for this input command to send to the client.voidgetReadVariableNames(Set<String> varNames)Retrieves all variable names that are read in this command and adds them to the specified set.StringgetStatementLog(WoolVariableStore varStore)Returns the string to use in the user statement log in place of this input command.StringgetVariableName()voidgetWriteVariableNames(Set<String> varNames)Retrieves all variable names that are written in this command and adds them to the specified set.static WoolInputCommandparse(WoolBodyToken cmdStartToken, Map<String,WoolBodyToken> attrs)voidsetMax(Integer max)voidsetMin(Integer min)voidsetVariableName(String variableName)StringtoString()-
Methods inherited from class nl.rrd.wool.model.command.WoolInputCommand
findReplyById, getNodePointers, getType, parse, setType
-
Methods inherited from class nl.rrd.wool.model.command.WoolAttributesCommand
parseAttributesCommand, readAttr, readIntAttr, readPlainTextAttr, readVariableAttr
-
-
-
-
Constructor Detail
-
WoolInputNumericCommand
public WoolInputNumericCommand(String variableName)
-
WoolInputNumericCommand
public WoolInputNumericCommand(WoolInputNumericCommand other)
-
-
Method Detail
-
getVariableName
public String getVariableName()
-
setVariableName
public void setVariableName(String variableName)
-
getMin
public Integer getMin()
-
setMin
public void setMin(Integer min)
-
getMax
public Integer getMax()
-
setMax
public void setMax(Integer max)
-
getParameters
public Map<String,?> getParameters()
Description copied from class:WoolInputCommandReturns the parameters for this input command to send to the client. This is a map from parameter names to values. A value can be any JSON type. This method should only be called on a command that has already been executed withexecuteBodyCommand(). This means that any variables in parameter values have already been resolved.- Specified by:
getParametersin classWoolInputCommand- Returns:
- the parameters for this input command to send to the client
-
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
-
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
-
getStatementLog
public String getStatementLog(WoolVariableStore varStore)
Description copied from class:WoolInputCommandReturns the string to use in the user statement log in place of this input command. It can use variable values from the specified variable store. This method should only be called on a command that has already been executed withexecuteBodyCommand(). This means that any variables in parameter values have already been resolved.- Specified by:
getStatementLogin classWoolInputCommand- Parameters:
varStore- the variable store- Returns:
- the statement log
-
clone
public WoolInputNumericCommand 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 WoolInputCommand parse(WoolBodyToken cmdStartToken, Map<String,WoolBodyToken> attrs) throws LineNumberParseException
- Throws:
LineNumberParseException
-
-