Class AsSynchronizedGraph.Builder<V,E>

java.lang.Object
org.jgrapht.graph.concurrent.AsSynchronizedGraph.Builder<V,E>
Type Parameters:
V - the graph vertex type
E - the graph edge type
Enclosing class:
AsSynchronizedGraph<V,E>

public static class AsSynchronizedGraph.Builder<V,E> extends Object
A builder for AsSynchronizedGraph.
Author:
CHEN Kui
  • Constructor Details

    • Builder

      public Builder()
      Construct a new Builder with non-fair mode, cache disabled, and copyless mode disabled.
    • Builder

      public Builder(AsSynchronizedGraph<V,E> graph)
      Construct a new Builder matching the settings of an existing graph.
      Parameters:
      graph - the graph on which to base the builder
  • Method Details

    • cacheDisable

      public AsSynchronizedGraph.Builder<V,E> cacheDisable()
      Request a synchronized graph without caching.
      Returns:
      the Builder
    • cacheEnable

      public AsSynchronizedGraph.Builder<V,E> cacheEnable()
      Request a synchronized graph with caching.
      Returns:
      the Builder
    • isCacheEnable

      public boolean isCacheEnable()
      Return whether a cache will be used for the synchronized graph being built.
      Returns:
      true if cache will be used, false if cache will not be used
    • setCopyless

      public AsSynchronizedGraph.Builder<V,E> setCopyless()
      Request a synchronized graph which does not return collection copies.
      Returns:
      the Builder
    • clearCopyless

      public AsSynchronizedGraph.Builder<V,E> clearCopyless()
      Request a synchronized graph which returns collection copies.
      Returns:
      the Builder
    • isCopyless

      public boolean isCopyless()
      Return whether copyless mode will be used for the synchronized graph being built.
      Returns:
      true if constructed as copyless, false otherwise
    • setFair

      public AsSynchronizedGraph.Builder<V,E> setFair()
      Request a synchronized graph with fair mode.
      Returns:
      the SynchronizedGraphParams
    • setNonfair

      public AsSynchronizedGraph.Builder<V,E> setNonfair()
      Request a synchronized graph with non-fair mode.
      Returns:
      the SynchronizedGraphParams
    • isFair

      public boolean isFair()
      Return whether fair mode will be used for the synchronized graph being built.
      Returns:
      true if constructed as fair mode, false if non-fair
    • build

      public AsSynchronizedGraph<V,E> build(Graph<V,E> graph)
      Build the AsSynchronizedGraph.
      Parameters:
      graph - the backing graph (the delegate)
      Returns:
      the AsSynchronizedGraph