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.

    Methods inherited from interface org.graphstream.algorithm.Algorithm

    compute, init
  • 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

      void setFlagAttribute​(String flagAttribute)
      Set the flag attribute.
      Parameters:
      flagAttribute - New attribute used. If null edges are not tagged.
      Throws:
      IllegalStateException - if Algorithm.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

      void setFlagOn​(Object flagOn)
      Set value used to set that an edge is in the spanning tree.
      Parameters:
      flagOn - on value. If null edges in the tree are not tagged.
      Throws:
      IllegalStateException - if Algorithm.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

      void setFlagOff​(Object flagOff)
      Set value used to set that an edge is not in the spanning tree.
      Parameters:
      flagOff - off value. If null edges out of the tree are not tagged.
      Throws:
      IllegalStateException - if Algorithm.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

      <T extends org.graphstream.graph.Edge> Iterable<T> getTreeEdges()
      Iterable view of the spanning tree edges. This implementation uses getTreeEdgesStream().
      Type Parameters:
      T - elements
      Returns:
      Iterable view of the tree edges.