org.jgrapht.experimental.dag

## Class DirectedAcyclicGraph.VisitedBitSetImpl

- java.lang.Object
- - org.jgrapht.experimental.dag.DirectedAcyclicGraph.VisitedBitSetImpl

- All Implemented Interfaces:
    Serializable, DirectedAcyclicGraph.Visited, DirectedAcyclicGraph.VisitedFactory
  Enclosing class:
    DirectedAcyclicGraph<V,E>

      public static class DirectedAcyclicGraph.VisitedBitSetImpl
      extends Object
      implements DirectedAcyclicGraph.Visited, DirectedAcyclicGraph.VisitedFactory

  This implementation is close to the performance of VisitedArrayListImpl, with 1/8 the memory usage.
  Author:
    perfecthash
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DirectedAcyclicGraph.VisitedBitSetImpl()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearVisited(int index)` Clear the visited state of the given topological index
    `DirectedAcyclicGraph.Visited` | `getInstance(DirectedAcyclicGraph.Region affectedRegion)`
    `boolean` | `getVisited(int index)` has the given topological index been visited?
    `void` | `setVisited(int index)` mark the given topological index as visited

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DirectedAcyclicGraph.VisitedBitSetImpl

          public DirectedAcyclicGraph.VisitedBitSetImpl()

  - ### Method Detail

    - #### getInstance

          public DirectedAcyclicGraph.Visited getInstance(DirectedAcyclicGraph.Region affectedRegion)

      Specified by:
        `getInstance` in interface `DirectedAcyclicGraph.VisitedFactory`

    - #### setVisited

          public void setVisited(int index)

      Description copied from interface: `DirectedAcyclicGraph.Visited`
      mark the given topological index as visited
      Specified by:
        `setVisited` in interface `DirectedAcyclicGraph.Visited`
      Parameters:
        `index` - the topological index

    - #### 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

    - #### clearVisited

          public void clearVisited(int index)
                            throws UnsupportedOperationException

      Description copied from interface: `DirectedAcyclicGraph.Visited`
      Clear the visited state of the given topological index
      Specified by:
        `clearVisited` in interface `DirectedAcyclicGraph.Visited`
      Throws:
        `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.

Copyright © 2016. All rights reserved.