Package net.automatalib.graph
Interface MutableGraph<N,E,NP,EP>
-
- Type Parameters:
N
- node classE
- edge classNP
- node property classEP
- edge property class
- All Superinterfaces:
FiniteRepresentation
,Graph<N,E>
,IndefiniteGraph<N,E>
,IndefiniteSimpleGraph<N>
,Iterable<N>
,SimpleGraph<N>
,UniversalGraph<N,E,NP,EP>
,UniversalIndefiniteGraph<N,E,NP,EP>
- All Known Subinterfaces:
MutableProceduralModalProcessGraph<N,L,E,AP,TP>
,MutableUniversalBidirectionalGraph<N,E,NP,EP>
- All Known Implementing Classes:
AbstractCompactBidiGraph
,AbstractCompactGraph
,CompactBidiGraph
,CompactGraph
,CompactPMPG
,CompactSimpleBidiGraph
,CompactSimpleGraph
,SimpleMapGraph
,WitnessTree
public interface MutableGraph<N,E,NP,EP> extends UniversalGraph<N,E,NP,EP>
A graph that allows modification. Note that this interface only exposes methods for extending a graph. If also destructive modifications should be performed,ShrinkableGraph
is the adequate interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MutableGraph.IntAbstraction<E,NP,EP>
Interface fornode integer abstractions
of aMutableGraph
.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default N
addNode()
Adds a new node with default properties to the graph.N
addNode(@Nullable NP property)
Adds a new node to the graph.default E
connect(N source, N target)
Inserts an edge in the graph, with the default property.E
connect(N source, N target, @Nullable EP property)
Inserts an edge in the graph.void
setEdgeProperty(E edge, EP property)
Sets the edge property of the given edge.void
setNodeProperty(N node, NP property)
Sets the node property of the given node.-
Methods inherited from interface net.automatalib.graph.Graph
getAdjacentNodes, getOutgoingEdges, getOutgoingEdgesIterator, getVisualizationHelper
-
Methods inherited from interface net.automatalib.graph.IndefiniteGraph
getAdjacentNodesIterator, getEdgesBetween, getTarget
-
Methods inherited from interface net.automatalib.graph.IndefiniteSimpleGraph
createDynamicNodeMapping, createStaticNodeMapping, isConnected
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface net.automatalib.graph.SimpleGraph
getNodes, iterator, nodeIDs, size
-
Methods inherited from interface net.automatalib.graph.UniversalIndefiniteGraph
getEdgeProperty, getNodeProperty
-
-
-
-
Method Detail
-
addNode
default N addNode()
Adds a new node with default properties to the graph. This method behaves equivalently to the belowaddNode(Object)
with anull
parameter.- Returns:
- the newly inserted node
-
addNode
N addNode(@Nullable NP property)
Adds a new node to the graph.- Parameters:
property
- the property for the new node- Returns:
- the newly inserted node
-
connect
default E connect(N source, N target)
Inserts an edge in the graph, with the default property. Calling this method should be equivalent to invokingconnect(Object, Object, Object)
with anull
property value.- Parameters:
source
- the source nodetarget
- the target node- Returns:
- the edge connecting the given nodes
-
connect
E connect(N source, N target, @Nullable EP property)
Inserts an edge in the graph.- Parameters:
source
- the source node of the edgetarget
- the target node of the edgeproperty
- the property of the edge- Returns:
- the newly inserted edge
-
setNodeProperty
void setNodeProperty(N node, NP property)
Sets the node property of the given node.- Parameters:
node
- the nodeproperty
- the property to set
-
-