Package org.openhab.core.voice.text
Class ASTNode
java.lang.Object
org.openhab.core.voice.text.ASTNode
Abstract syntax tree node. Result of parsing an expression.
- Author:
- Tilman Kamp - Initial contribution
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionBreadth searching this (sub-) tree/node for a node with the given name.Breadth searches this (sub-) tree/node for a node with the given name and returning its value.Breadth searches this (sub-) tree/node for a node with the given name and type and returning its value.findValueAsString(String name) Breadth searches this (sub-) tree/node for a node with the given name and returning its value as aString.String[]findValueAsStringArray(String name) Breadth searches this (sub-) tree/node for a node with the given name and returning its value as aString[].ASTNode[]getName()getTag()getValue()String[]booleanvoidsetChildren(ASTNode[] children) voidvoidsetRemainingTokens(TokenList remainingTokens) voidsetSuccess(boolean success) voidvoid
- 
Constructor Details- 
ASTNodepublic ASTNode()
- 
ASTNodeConstructs a new AST node.- Parameters:
- children- the node's children
- remainingTokens- remaining token list starting with the first token that was not covered/consumed
 
 
- 
- 
Method Details- 
findNodeBreadth searching this (sub-) tree/node for a node with the given name.- Parameters:
- name- the name that's used for looking up the tree
- Returns:
- first node with the given name or null, if none was found
 
- 
getValueAsStringArray- Returns:
- the value of this node as String[]
 
- 
getValueAsString- Returns:
- the value of this node as String.
 
- 
findValueAsStringArrayBreadth searches this (sub-) tree/node for a node with the given name and returning its value as aString[].- Parameters:
- name- the name of the named node to be found
- Returns:
- the value of the resulting node as String[]or null if not found
 
- 
findValueAsStringBreadth searches this (sub-) tree/node for a node with the given name and returning its value as aString.- Parameters:
- name- the name of the named node to be found
- Returns:
- the value of the resulting node as Stringor null if not found
 
- 
findValueBreadth searches this (sub-) tree/node for a node with the given name and type and returning its value.- Parameters:
- name- the name of the named node to be found
- cls- the node's value has to be assignable to a reference of this class to match during search
- Returns:
- the value of the resulting node. Null, if not found or the value does not match cls.
 
- 
findValueBreadth searches this (sub-) tree/node for a node with the given name and returning its value.- Parameters:
- name- the name of the named node to be found
- Returns:
- the value of the resulting node. Null, if not found.
 
- 
isSuccesspublic boolean isSuccess()- Returns:
- if the node is a valid one (true) or parsing was not successful (false)
 
- 
setSuccesspublic void setSuccess(boolean success) - Parameters:
- success- if the node is a valid one (true) or parsing was not successful (false)
 
- 
getChildren- Returns:
- the children
 
- 
setChildren- Parameters:
- children- the children to set
 
- 
getRemainingTokens- Returns:
- the remainingTokens
 
- 
setRemainingTokens- Parameters:
- remainingTokens- the remainingTokens to set
 
- 
getName- Returns:
- the name
 
- 
setName- Parameters:
- name- the name to set
 
- 
getValue- Returns:
- the value
 
- 
setValue- Parameters:
- value- the value to set
 
- 
getTag- Returns:
- the tag
 
- 
setTag- Parameters:
- tag- the tag to set
 
 
-