Record Class TreeContext
java.lang.Object
java.lang.Record
es.urjc.etsii.grafo.autoconfig.generator.TreeContext
- Record Components:
maxDepth- maximum allowed depthmaxRepeat- how many times can each derivation rule be applied.branch- current branch, represented as a list of component implementation namesderivationCounter- counts how many times each derivation rule has been applied in the current branch
public record TreeContext(int maxDepth, int maxRepeat, ArrayDeque<Class<?>> branch, HashMap<Derivation, Integer> derivationCounter)
extends Record
Tracks the exploration of the autoconfig grammar.
-
Constructor Summary
ConstructorsConstructorDescriptionTreeContext(int maxDepth, int maxRepeatDerivation) TreeContext(int maxDepth, int maxRepeat, ArrayDeque<Class<?>> branch, HashMap<Derivation, Integer> derivationCounter) Creates an instance of aTreeContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionArrayDeque<Class<?>> branch()Returns the value of thebranchrecord component.Returns the value of thederivationCounterrecord component.final booleanIndicates whether some other object is "equal to" this one.intfinal inthashCode()Returns a hash code value for this object.booleanintmaxDepth()Returns the value of themaxDepthrecord component.intReturns the value of themaxRepeatrecord component.voidpop()voidvoidvoidfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TreeContext
public TreeContext(int maxDepth, int maxRepeatDerivation) -
TreeContext
public TreeContext(int maxDepth, int maxRepeat, ArrayDeque<Class<?>> branch, HashMap<Derivation, Integer> derivationCounter) Creates an instance of aTreeContextrecord class.- Parameters:
maxDepth- the value for themaxDepthrecord componentmaxRepeat- the value for themaxRepeatrecord componentbranch- the value for thebranchrecord componentderivationCounter- the value for thederivationCounterrecord component
-
-
Method Details
-
push
-
pop
public void pop() -
pushDerivation
-
getDerivationCount
-
popDerivation
-
inLimits
-
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. -
maxDepth
-
maxRepeat
-
branch
-
derivationCounter
Returns the value of thederivationCounterrecord component.- Returns:
- the value of the
derivationCounterrecord component
-