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 for
AsSynchronizedGraph.- 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
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.booleanisCacheEnable()Return whether a cache will be used for the synchronized graph being built.booleanisCopyless()Return whether copyless mode will be used for the synchronized graph being built.booleanisFair()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 Details
-
Method Details
-
cacheDisable
Request a synchronized graph without caching.- Returns:
- the Builder
-
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:
trueif cache will be used,falseif cache will not be used
-
setCopyless
Request a synchronized graph which does not return collection copies.- Returns:
- the Builder
-
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:
trueif constructed as copyless,falseotherwise
-
setFair
Request a synchronized graph with fair mode.- Returns:
- the SynchronizedGraphParams
-
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:
trueif constructed as fair mode,falseif non-fair
-
build
Build the AsSynchronizedGraph.- Parameters:
graph- the backing graph (the delegate)- Returns:
- the AsSynchronizedGraph
-