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 aTreeContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionArrayDeque
<Class<?>> branch()
Returns the value of thebranch
record component.Returns the value of thederivationCounter
record component.final boolean
Indicates whether some other object is "equal to" this one.int
final int
hashCode()
Returns a hash code value for this object.boolean
int
maxDepth()
Returns the value of themaxDepth
record component.int
Returns the value of themaxRepeat
record component.void
pop()
void
void
void
final String
toString()
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 aTreeContext
record class.- Parameters:
maxDepth
- the value for themaxDepth
record componentmaxRepeat
- the value for themaxRepeat
record componentbranch
- the value for thebranch
record componentderivationCounter
- the value for thederivationCounter
record 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 themaxDepth
record component.- Returns:
- the value of the
maxDepth
record component
-
maxRepeat
public int maxRepeat()Returns the value of themaxRepeat
record component.- Returns:
- the value of the
maxRepeat
record component
-
branch
Returns the value of thebranch
record component.- Returns:
- the value of the
branch
record component
-
derivationCounter
Returns the value of thederivationCounter
record component.- Returns:
- the value of the
derivationCounter
record component
-