Class DirectedAcyclicGraph.VisitedArrayListImpl

    • Constructor Detail

      • VisitedArrayListImpl

        public VisitedArrayListImpl()
    • Method Detail

      • getVisited

        public boolean getVisited​(int index)
        Description copied from interface: DirectedAcyclicGraph.Visited
        Has the given topological index been visited?
        Specified by:
        getVisited in interface DirectedAcyclicGraph.Visited
        Parameters:
        index - the topological index
        Returns:
        true if the given topological index been visited, false otherwise
      • clearVisited

        public void clearVisited​(int index)
                          throws java.lang.UnsupportedOperationException
        Description copied from interface: DirectedAcyclicGraph.Visited
        Clear the visited state of the given topological index
        Specified by:
        clearVisited in interface DirectedAcyclicGraph.Visited
        Parameters:
        index - the index
        Throws:
        java.lang.UnsupportedOperationException - if the implementation doesn't support (or doesn't need) clearance. For example, if the factory vends a new instance every time, it is a waste of cycles to clear the state after the search of the Affected Region is done, so an UnsupportedOperationException *should* be thrown.
      • translateIndex

        private int translateIndex​(int index)
        We translate the topological index to an ArrayList index. We have to do this because topological indices can be negative, and we want to do it because we can make better use of space by only needing an ArrayList of size |AR|.
        Returns:
        the ArrayList index