Record Class DerivationTree.TerminalNode
java.lang.Object
java.lang.Record
com.knezevic.edaf.v3.repr.grammar.model.DerivationTree.TerminalNode
- All Implemented Interfaces:
DerivationTree
- Enclosing interface:
DerivationTree
public static record DerivationTree.TerminalNode(Terminal terminal, Double sampledValue, int depth)
extends Record
implements DerivationTree
Leaf terminal node.
For ERC nodes, sampledValue stores sampled numeric constant.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.knezevic.edaf.v3.repr.grammar.model.DerivationTree
DerivationTree.RuleNode, DerivationTree.TerminalNode -
Constructor Summary
ConstructorsConstructorDescriptionTerminalNode(Terminal terminal, Double sampledValue, int depth) Immutable constructor. -
Method Summary
Modifier and TypeMethodDescriptionchildren()Child nodes.intdepth()Returns the value of thedepthrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Output type of this expression node.Returns the value of thesampledValuerecord component.terminal()Returns the value of theterminalrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.knezevic.edaf.v3.repr.grammar.model.DerivationTree
isTerminal
-
Constructor Details
-
TerminalNode
-
-
Method Details
-
outputType
Description copied from interface:DerivationTreeOutput type of this expression node.- Specified by:
outputTypein interfaceDerivationTree
-
children
Description copied from interface:DerivationTreeChild nodes.- Specified by:
childrenin interfaceDerivationTree
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
terminal
Returns the value of theterminalrecord component.- Returns:
- the value of the
terminalrecord component
-
sampledValue
Returns the value of thesampledValuerecord component.- Returns:
- the value of the
sampledValuerecord component
-
depth
public int depth()Returns the value of thedepthrecord component.- Specified by:
depthin interfaceDerivationTree- Returns:
- the value of the
depthrecord component
-