Interface GraphFactory


  • public interface GraphFactory
    Factory for nodes and edges.

    All new nodes and edges are created by this factory.

    Both nodes and edges have unique identifiers. If not provided, a unique id will be automatically assigned to the elements.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Edge newEdge​(Object id, Node source, Node target, int type, double weight, boolean directed)
      Creates and returns an edge between source and target.
      Edge newEdge​(Node source, Node target)
      Creates and returns a directed edge between source and target.
      Edge newEdge​(Node source, Node target, boolean directed)
      Creates and returns an edge between source and target.
      Edge newEdge​(Node source, Node target, int type, boolean directed)
      Creates and returns an edge between source and target.
      Edge newEdge​(Node source, Node target, int type, double weight, boolean directed)
      Creates and returns an edge between source and target.
      Node newNode()
      Creates and returns a node.
      Node newNode​(Object id)
      Creates and returns a node.
    • Method Detail

      • newEdge

        Edge newEdge​(Node source,
                     Node target)
        Creates and returns a directed edge between source and target.
        Parameters:
        source - the source node
        target - the target node
        Returns:
        the new edge
      • newEdge

        Edge newEdge​(Node source,
                     Node target,
                     boolean directed)
        Creates and returns an edge between source and target.
        Parameters:
        source - the source node
        target - the target node
        directed - true if directed, false if undirected
        Returns:
        the new edge
      • newEdge

        Edge newEdge​(Node source,
                     Node target,
                     int type,
                     boolean directed)
        Creates and returns an edge between source and target.
        Parameters:
        source - the source node
        target - the target node
        type - the edge type
        directed - true if directed, false if undirected
        Returns:
        the new edge
      • newEdge

        Edge newEdge​(Node source,
                     Node target,
                     int type,
                     double weight,
                     boolean directed)
        Creates and returns an edge between source and target.
        Parameters:
        source - the source node
        target - the target node
        type - the edge type
        weight - the edge weight
        directed - true if directed, false if undirected
        Returns:
        the new edge
      • newEdge

        Edge newEdge​(Object id,
                     Node source,
                     Node target,
                     int type,
                     double weight,
                     boolean directed)
        Creates and returns an edge between source and target.
        Parameters:
        id - the edge id
        source - the source node
        target - the target node
        type - the edge type
        weight - the edge weight
        directed - true if directed, false if undirected
        Returns:
        the new edge
      • newNode

        Node newNode()
        Creates and returns a node.
        Returns:
        the new node
      • newNode

        Node newNode​(Object id)
        Creates and returns a node.
        Parameters:
        id - the node id
        Returns:
        the new node