Interface Network

  • All Known Implementing Classes:
    DefaultNetwork

    public interface Network
    Describes a network used in DFS analysis by the Shrinker. This is a directed graph which is capable of addition. A default implementation exists, but more elaborate backends can be used as well.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object createEdge​(java.lang.Object source, java.lang.Object target)
      Creates a new edge object
      java.lang.Object createNode()
      Creates a new node object
      java.util.Iterator edges()
      Retrieve an iterator to the collection of egdes this network has
      java.util.Iterator edgesConnecting​(java.lang.Object source, java.lang.Object target)
      Returns all edges connecting source and target nodes
      java.lang.Object firstInEdge​(java.lang.Object node)
      Returns the first ingoing edge for this node, if any.
      java.lang.Object firstOutEdge​(java.lang.Object node)
      Returns the first outgoing edge for this node, if any.
      java.lang.Object getSource​(java.lang.Object edge)
      Get the source node of an edge
      java.lang.Object getTarget​(java.lang.Object edge)
      Get the target node of an edge
      java.util.Iterator inEdges​(java.lang.Object node)
      Returns all ingoing edges of this node.
      java.lang.Object nextInEdge​(java.lang.Object edge)
      Returns the next edge (in insertion order) connecting source and target node, if any.
      java.lang.Object nextOutEdge​(java.lang.Object edge)
      Returns the next edge (in insertion order) that is outgoing of target node, if any.
      java.util.Iterator nodes()
      Retrieve an iterator to the collection of nodes this network has
      java.lang.Integer nodesSize()
      How many nodes this network has
      java.lang.Object opposite​(java.lang.Object edge, java.lang.Object node)
      Returns the edge going in opposite direction of this edge in insertion order, respectively to the given node, if any.
      java.util.Iterator outEdges​(java.lang.Object node)
      Returns all outgoing edges of this node.
    • Method Detail

      • createNode

        java.lang.Object createNode()
        Creates a new node object
        Returns:
        node
      • createEdge

        java.lang.Object createEdge​(java.lang.Object source,
                                    java.lang.Object target)
        Creates a new edge object
        Parameters:
        source - - the source node
        target - - the target node
        Returns:
        edge
      • getSource

        java.lang.Object getSource​(java.lang.Object edge)
        Get the source node of an edge
        Parameters:
        edge - - the edge to get the source of
        Returns:
        node
      • getTarget

        java.lang.Object getTarget​(java.lang.Object edge)
        Get the target node of an edge
        Parameters:
        edge - - the edge to get the target of
        Returns:
        node
      • nodes

        java.util.Iterator nodes()
        Retrieve an iterator to the collection of nodes this network has
        Returns:
        nodes[]
      • edges

        java.util.Iterator edges()
        Retrieve an iterator to the collection of egdes this network has
        Returns:
        edges[]
      • nodesSize

        java.lang.Integer nodesSize()
        How many nodes this network has
        Returns:
        number of nodes
      • inEdges

        java.util.Iterator inEdges​(java.lang.Object node)
        Returns all ingoing edges of this node.
        Returns:
        edge[]
      • outEdges

        java.util.Iterator outEdges​(java.lang.Object node)
        Returns all outgoing edges of this node.
        Returns:
        edge[]
      • firstInEdge

        java.lang.Object firstInEdge​(java.lang.Object node)
        Returns the first ingoing edge for this node, if any.
        Returns:
        {edge|null}
      • firstOutEdge

        java.lang.Object firstOutEdge​(java.lang.Object node)
        Returns the first outgoing edge for this node, if any.
        Returns:
        {edge|null}
      • nextInEdge

        java.lang.Object nextInEdge​(java.lang.Object edge)
        Returns the next edge (in insertion order) connecting source and target node, if any.
        Parameters:
        edge - - the edge for which to retrieve incoming edges
        Returns:
        {edge|null}
      • nextOutEdge

        java.lang.Object nextOutEdge​(java.lang.Object edge)
        Returns the next edge (in insertion order) that is outgoing of target node, if any.
        Parameters:
        edge - - the edge for which to retrieve outgoing edges
        Returns:
        {edge|null}
      • edgesConnecting

        java.util.Iterator edgesConnecting​(java.lang.Object source,
                                           java.lang.Object target)
        Returns all edges connecting source and target nodes
        Parameters:
        source - - the source node
        target - - the target node
        Returns:
        a collection iterator of edges
      • opposite

        java.lang.Object opposite​(java.lang.Object edge,
                                  java.lang.Object node)
        Returns the edge going in opposite direction of this edge in insertion order, respectively to the given node, if any.
        Parameters:
        node - - the node for which to get the opposite node
        Returns:
        {Node}