Package org.graphstream.algorithm
Interface SpanningTree
- All Superinterfaces:
Algorithm
- All Known Implementing Classes:
AbstractSpanningTree
,Dijkstra
,Kruskal
,Prim
public interface SpanningTree extends Algorithm
This interface defines the basic functionalities of a spanning tree algorithm.
It defines methods related to tagging the edges of the spanning tree and for iterating on them.
-
Method Summary
Modifier and Type Method Description void
clear()
Removes the tags of all edges.String
getFlagAttribute()
Get key attribute which will be used to set if edges are in the spanning tree, or not.Object
getFlagOff()
Get value used to set that an edge is not in the spanning tree.Object
getFlagOn()
Get value used to set that an edge is in the spanning tree.<T extends org.graphstream.graph.Edge>
Iterable<T>getTreeEdges()
Iterable view of the spanning tree edges.Stream<org.graphstream.graph.Edge>
getTreeEdgesStream()
An iterator on the tree edges.void
setFlagAttribute(String flagAttribute)
Set the flag attribute.void
setFlagOff(Object flagOff)
Set value used to set that an edge is not in the spanning tree.void
setFlagOn(Object flagOn)
Set value used to set that an edge is in the spanning tree.
-
Method Details
-
getFlagAttribute
String getFlagAttribute()Get key attribute which will be used to set if edges are in the spanning tree, or not.- Returns:
- flag attribute
-
setFlagAttribute
Set the flag attribute.- Parameters:
flagAttribute
- New attribute used. Ifnull
edges are not tagged.- Throws:
IllegalStateException
- ifAlgorithm.init(Graph)
is already called
-
getFlagOn
Object getFlagOn()Get value used to set that an edge is in the spanning tree.- Returns:
- on value
-
setFlagOn
Set value used to set that an edge is in the spanning tree.- Parameters:
flagOn
- on value. Ifnull
edges in the tree are not tagged.- Throws:
IllegalStateException
- ifAlgorithm.init(Graph)
is already called
-
getFlagOff
Object getFlagOff()Get value used to set that an edge is not in the spanning tree.- Returns:
- off value
-
setFlagOff
Set value used to set that an edge is not in the spanning tree.- Parameters:
flagOff
- off value. Ifnull
edges out of the tree are not tagged.- Throws:
IllegalStateException
- ifAlgorithm.init(Graph)
is already called
-
clear
void clear()Removes the tags of all edges. Use this method to save memory if the spanning tree is used no more. -
getTreeEdgesStream
Stream<org.graphstream.graph.Edge> getTreeEdgesStream()An iterator on the tree edges.- Returns:
- An iterator on the tree edges
-
getTreeEdges
Iterable view of the spanning tree edges. This implementation usesgetTreeEdgesStream()
.- Type Parameters:
T
- elements- Returns:
- Iterable view of the tree edges.
-