Gephi Toolkit Javadoc

org.gephi.graph.api
Interface GraphFactory


public interface GraphFactory

Graph factory that builds node and edges elements. Belongs to a GraphModel.

Author:
Mathieu Bastian

Method Summary
 Edge newEdge(Node source, Node target)
          Create a new edge.
 Edge newEdge(Node source, Node target, float weight, boolean directed)
          Creates a new edge.
 Edge newEdge(java.lang.String id, Node source, Node target, float weight, boolean directed)
          Creates a new edge.
 Node newNode()
          Create a new node, with default identifier.
 Node newNode(java.lang.String id)
          Create a new node with an identifier.
 

Method Detail

newNode

Node newNode()
Create a new node, with default identifier.

Returns:
a new node instance

newNode

Node newNode(java.lang.String id)
Create a new node with an identifier. If id is null a default identifier is used.

Parameters:
id - a unique identifier, could be null
Returns:
a new node instance

newEdge

Edge newEdge(Node source,
             Node target)
Create a new edge. This method don't force the type of edge (directed or undirected). That means it is directed by default but will be considered as undirected if queried from an UndirectedGraph.

Edge's weight is 1.0 by default.

Parameters:
source - the edge's source
target - the edge's target
Returns:
a new proper edge instance

newEdge

Edge newEdge(Node source,
             Node target,
             float weight,
             boolean directed)
Creates a new edge.

Parameters:
source - the edge's source
target - the edge's targer
weight - the edge's weight
directed - the edge's type
Returns:
a new mixed edge instance

newEdge

Edge newEdge(java.lang.String id,
             Node source,
             Node target,
             float weight,
             boolean directed)
Creates a new edge.

Parameters:
id - a unique identifier, could be null
source - the edge's source
target - the edge's targer
weight - the edge's weight
directed - the edge's type
Returns:
a new mixed edge instance

Gephi Toolkit Javadoc