N - node typepublic class SimpleMapGraph<N> extends Object implements MutableGraph<N,N,N,Void>, ShrinkableGraph<N,N>
This class provides maximum flexibility, but should only be used if performance is not a major concern.
SimpleGraph.NormalGraphView<N,G extends SimpleGraph<N>>| Constructor and Description |
|---|
SimpleMapGraph()
|
SimpleMapGraph(Map<N,Collection<N>> structureMap)
Initializes a graph using the given adjacency structure, and adjacency information for a single node is stored
using
HashSets. |
SimpleMapGraph(Map<N,Collection<N>> structureMap,
Supplier<? extends Collection<N>> adjCollSupplier)
Initializes a graph using the given adjacency structure, and adjacency information for a single node is stored in
data structures created via the provided supplier.
|
SimpleMapGraph(Supplier<? extends Collection<N>> adjCollSupplier)
Initializes a graph where the adjacency structure is stored using a
HashMap, and adjacency information
for a single node is stored in data structures created via the provided supplier. |
| Modifier and Type | Method and Description |
|---|---|
N |
addNode(N property) |
Iterator<N> |
adjacentTargetsIterator(N node) |
Stream<N> |
adjacentTargetsStream(N node) |
N |
connect(N source,
N target,
Void property) |
Collection<N> |
getAdjacentTargets(N node) |
Void |
getEdgeProperty(N edge) |
N |
getNodeProperty(N node) |
Set<N> |
getNodes() |
Collection<N> |
getOutgoingEdges(N node) |
N |
getTarget(N edge) |
Iterator<N> |
iterator() |
void |
removeEdge(N node,
N edge) |
void |
removeNode(N node) |
void |
removeNode(N node,
N replacement) |
void |
setEdgeProperty(N edge,
Void property) |
void |
setNodeProperty(N node,
N property)
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddNode, connectasNormalGraph, getVisualizationHelpernodeIDs, nodesStream, sizeforEach, spliteratorgetEdgesBetween, outgoingEdges, outgoingEdgesIterator, outgoingEdgesStreamadjacentTargets, createDynamicNodeMapping, createStaticNodeMapping, isConnectedpublic SimpleMapGraph()
public SimpleMapGraph(Map<N,Collection<N>> structureMap, Supplier<? extends Collection<N>> adjCollSupplier)
structureMap - the map for the overall graph structureadjCollSupplier - the supplier for per-node adjacency collectionspublic SimpleMapGraph(Supplier<? extends Collection<N>> adjCollSupplier)
HashMap, and adjacency information
for a single node is stored in data structures created via the provided supplier.adjCollSupplier - the supplier for per-node adjacency collectionspublic SimpleMapGraph(Map<N,Collection<N>> structureMap)
HashSets.structureMap - the map for the overall graph structurepublic Iterator<N> adjacentTargetsIterator(N node)
adjacentTargetsIterator in interface IndefiniteGraph<N,N>adjacentTargetsIterator in interface IndefiniteSimpleGraph<N>public Collection<N> getAdjacentTargets(N node)
getAdjacentTargets in interface IndefiniteGraph<N,N>getAdjacentTargets in interface IndefiniteSimpleGraph<N>public Stream<N> adjacentTargetsStream(N node)
adjacentTargetsStream in interface IndefiniteGraph<N,N>adjacentTargetsStream in interface IndefiniteSimpleGraph<N>public Collection<N> getOutgoingEdges(N node)
getOutgoingEdges in interface IndefiniteGraph<N,N>public Set<N> getNodes()
getNodes in interface SimpleGraph<N>public N getNodeProperty(N node)
getNodeProperty in interface UniversalIndefiniteGraph<N,N,N,Void>public Void getEdgeProperty(N edge)
getEdgeProperty in interface UniversalIndefiniteGraph<N,N,N,Void>@Deprecated public void setNodeProperty(N node, N property)
setNodeProperty in interface MutableGraph<N,N,N,Void>public void setEdgeProperty(N edge, Void property)
setEdgeProperty in interface MutableGraph<N,N,N,Void>public void removeNode(N node)
removeNode in interface ShrinkableGraph<N,N>public void removeNode(N node, N replacement)
removeNode in interface ShrinkableGraph<N,N>public void removeEdge(N node, N edge)
removeEdge in interface ShrinkableGraph<N,N>Copyright © 2019. All rights reserved.