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
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
maxDepth
public int maxDepth()Returns the value of themaxDepthrecord component.- Returns:
- the value of the
maxDepthrecord component
-
maxRepeat
public int maxRepeat()Returns the value of themaxRepeatrecord component.- Returns:
- the value of the
maxRepeatrecord component
-
branch
Returns the value of thebranchrecord component.- Returns:
- the value of the
branchrecord component
-
derivationCounter
Returns the value of thederivationCounterrecord component.- Returns:
- the value of the
derivationCounterrecord component
-