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>
A builder for
AsSynchronizedGraph
.- Author:
- CHEN Kui
-
Constructor Summary
ConstructorDescriptionBuilder()
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 TypeMethodDescriptionBuild the AsSynchronizedGraph.Request a synchronized graph without caching.Request a synchronized graph with caching.Request a synchronized graph which returns collection copies.boolean
Return whether a cache will be used for the synchronized graph being built.boolean
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.Request a synchronized graph which does not return collection copies.setFair()
Request a synchronized graph with fair mode.Request a synchronized graph with non-fair mode.
-
Constructor Details
-
Builder
public Builder()Construct a new Builder with non-fair mode, cache disabled, and copyless mode disabled. -
Builder
Construct a new Builder matching the settings of an existing graph.- Parameters:
graph
- the graph on which to base the builder
-
-
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:
true
if cache will be used,false
if 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:
true
if constructed as copyless,false
otherwise
-
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:
true
if constructed as fair mode,false
if non-fair
-
build
Build the AsSynchronizedGraph.- Parameters:
graph
- the backing graph (the delegate)- Returns:
- the AsSynchronizedGraph
-