Record Class TreeContext

java.lang.Object
java.lang.Record
es.urjc.etsii.grafo.autoconfig.generator.TreeContext
Record Components:
maxDepth - maximum allowed depth
maxRepeat - how many times can each derivation rule be applied.
branch - current branch, represented as a list of component implementation names
derivationCounter - 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 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 a TreeContext record class.
      Parameters:
      maxDepth - the value for the maxDepth record component
      maxRepeat - the value for the maxRepeat record component
      branch - the value for the branch record component
      derivationCounter - the value for the derivationCounter record component
  • Method Details

    • push

      public void push(Class<?> component)
    • pop

      public void pop()
    • pushDerivation

      public void pushDerivation(Derivation d)
    • getDerivationCount

      public int getDerivationCount(Derivation d)
    • popDerivation

      public void popDerivation(Derivation d)
    • inLimits

      public boolean inLimits(Derivation d)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • maxDepth

      public int maxDepth()
      Returns the value of the maxDepth record component.
      Returns:
      the value of the maxDepth record component
    • maxRepeat

      public int maxRepeat()
      Returns the value of the maxRepeat record component.
      Returns:
      the value of the maxRepeat record component
    • branch

      public ArrayDeque<Class<?>> branch()
      Returns the value of the branch record component.
      Returns:
      the value of the branch record component
    • derivationCounter

      public HashMap<Derivation,Integer> derivationCounter()
      Returns the value of the derivationCounter record component.
      Returns:
      the value of the derivationCounter record component