Module org.jgrapht.core
Package org.jgrapht.graph.concurrent
Class AsSynchronizedGraph.Builder<V,E>
- java.lang.Object
-
- org.jgrapht.graph.concurrent.AsSynchronizedGraph.Builder<V,E>
-
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- Enclosing class:
- AsSynchronizedGraph<V,E>
public static class AsSynchronizedGraph.Builder<V,E> extends java.lang.Object
A builder forAsSynchronizedGraph
.- Author:
- CHEN Kui
-
-
Constructor Summary
Constructors Constructor Description Builder()
Construct a new Builder with non-fair mode, cache disabled, and copyless mode disabled.Builder(AsSynchronizedGraph<V,E> graph)
Construct a new Builder matching the settings of an existing graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsSynchronizedGraph<V,E>
build(Graph<V,E> graph)
Build the AsSynchronizedGraph.AsSynchronizedGraph.Builder<V,E>
cacheDisable()
Request a synchronized graph without caching.AsSynchronizedGraph.Builder<V,E>
cacheEnable()
Request a synchronized graph with caching.AsSynchronizedGraph.Builder<V,E>
clearCopyless()
Request a synchronized graph which returns collection copies.boolean
isCacheEnable()
Return whether a cache will be used for the synchronized graph being built.boolean
isCopyless()
Return whether copyless mode will be used for the synchronized graph being built.boolean
isFair()
Return whether fair mode will be used for the synchronized graph being built.AsSynchronizedGraph.Builder<V,E>
setCopyless()
Request a synchronized graph which does not return collection copies.AsSynchronizedGraph.Builder<V,E>
setFair()
Request a synchronized graph with fair mode.AsSynchronizedGraph.Builder<V,E>
setNonfair()
Request a synchronized graph with non-fair mode.
-
-
-
Constructor Detail
-
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 Detail
-
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
-
-