Class Context


  • class Context
    extends java.lang.Object
    Stores knowledge about the current constraint visitation (the context of earlier elements).
    Author:
    El-Sharkawy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Deque<java.lang.String> currentParents  
      private int depth  
      private boolean elementsFound  
    • Constructor Summary

      Constructors 
      Constructor Description
      Context()
      Constructor for this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addParent​(java.lang.String parent)
      Adds a parent, e.g.
      (package private) void clear()
      Should be called after a constraint was visited completly, to clear the data.
      (package private) void compoundDown()
      Marks that a compound(access) was visited and that now a slot is visited of the compound.
      (package private) void compoundUp()
      A compound(slot) was visited, back to upper compound.
      (package private) int depth()
      Returns the depth, a depth > 0 means that currently a slot of a compound is visited).
      (package private) void elementFound()
      Marks that at least one variable was found during the current constraint visitation.
      (package private) boolean elementsWereFound()
      Returns whether variables were changed during the current constraint visitation.
      (package private) java.lang.String getParent()
      Returns the current visited parent of the current variable.
      (package private) boolean hasParent()
      Returns whether currently a qualified name for a IDecisionVariable as parent is stored for the current visitation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • currentParents

        private java.util.Deque<java.lang.String> currentParents
      • depth

        private int depth
      • elementsFound

        private boolean elementsFound
    • Constructor Detail

      • Context

        Context()
        Constructor for this class.
    • Method Detail

      • clear

        void clear()
        Should be called after a constraint was visited completly, to clear the data.
      • compoundDown

        void compoundDown()
        Marks that a compound(access) was visited and that now a slot is visited of the compound.
        See Also:
        compoundUp()
      • compoundUp

        void compoundUp()
        A compound(slot) was visited, back to upper compound.
        See Also:
        compoundDown()
      • depth

        int depth()
        Returns the depth, a depth > 0 means that currently a slot of a compound is visited).
        Returns:
        A value >= 0.
      • hasParent

        boolean hasParent()
        Returns whether currently a qualified name for a IDecisionVariable as parent is stored for the current visitation.
        Returns:
        true a parent exists for the current visited variable.
        See Also:
        getParent(), addParent(String)
      • getParent

        java.lang.String getParent()
        Returns the current visited parent of the current variable.
        Returns:
        The parent.
        See Also:
        hasParent(), addParent(String)
      • addParent

        void addParent​(java.lang.String parent)
        Adds a parent, e.g. if a compound access is visited.
        Parameters:
        parent - The current visited variable, before the visitation of the slot starts.
        See Also:
        getParent(), hasParent()
      • elementFound

        void elementFound()
        Marks that at least one variable was found during the current constraint visitation.
        See Also:
        elementsWereFound()
      • elementsWereFound

        boolean elementsWereFound()
        Returns whether variables were changed during the current constraint visitation.
        Returns:
        trueAt least one variable was found.
        See Also:
        elementFound()