Gephi Toolkit Javadoc

org.gephi.graph.api
Interface DirectedGraph

All Superinterfaces:
Attributable, Graph
All Known Subinterfaces:
HierarchicalDirectedGraph

public interface DirectedGraph
extends Graph

Graph with directed edges.

Author:
Mathieu Bastian
See Also:
GraphModel

Method Summary
 boolean addEdge(Node source, Node target)
          Add an edge between source and target to the graph.
 Edge getEdge(Node source, Node target)
          Finds and returns an edge that connects source and target.
 int getInDegree(Node node)
          Returns the number of incoming edges incident to node.
 EdgeIterable getInEdges(Node node)
          Returns incoming edges incident to node.
 int getMutualDegree(Node node)
          Returns the number of mutual edges incident to node.
 int getOutDegree(Node node)
          Returns the number of outgoing edges incident to node.
 EdgeIterable getOutEdges(Node node)
          Returns outgoing edges incident to node.
 NodeIterable getPredecessors(Node node)
          Returns node's predecessors.
 NodeIterable getSuccessors(Node node)
          Returns node's successors.
 boolean isPredecessor(Node node, Node predecessor)
          Returns true if predecessor is a predecessor of node.
 boolean isSuccessor(Node node, Node successor)
          Returns true if successor is a successor of node.
 
Methods inherited from interface org.gephi.graph.api.Graph
addEdge, addNode, clear, clearEdges, clearEdges, contains, contains, getDegree, getEdge, getEdge, getEdgeCount, getEdges, getEdges, getEdgeVersion, getGraphModel, getNeighbors, getNode, getNode, getNodeCount, getNodes, getNodeVersion, getOpposite, getView, isAdjacent, isAdjacent, isDirected, isSelfLoop, readLock, readUnlock, readUnlockAll, removeEdge, removeNode, setId, setId, writeLock, writeUnlock
 
Methods inherited from interface org.gephi.graph.api.Attributable
getAttributes
 

Method Detail

addEdge

boolean addEdge(Node source,
                Node target)
Add an edge between source and target to the graph. Graph does not accept parallel edges. Fails if a such edge already exists in the graph.

Parameters:
source - the source node
target - the target node
Returns:
true if add is successful, false otherwise
Throws:
java.lang.IllegalArgumentException - if source or target is null or not legal nodes for this edge
java.lang.IllegalMonitorStateException - if the current thread is holding a read lock

getEdge

Edge getEdge(Node source,
             Node target)
Finds and returns an edge that connects source and target. Returns null if no such edge is found.

Warning: This method is not thread safe, be sure to call it in a locked statement.

Specified by:
getEdge in interface Graph
Parameters:
source - the source node of the queried edge
target - the target node of the queried edge
Returns:
a directed edge that connects source and target or null if no such edge exists
Throws:
java.lang.IllegalArgumentException - if source or target is null or not legal nodes in the graph

getInEdges

EdgeIterable getInEdges(Node node)
Returns incoming edges incident to node.

Parameters:
node - the node whose incoming edges are to be returned
Returns:
an edge iterable of incoming edges incident to node
Throws:
java.lang.IllegalArgumentException - if node is null, or if node is not legal in the graph.

getOutEdges

EdgeIterable getOutEdges(Node node)
Returns outgoing edges incident to node.

Parameters:
node - the node whose outgoing edges are to be returned
Returns:
an edge iterable of outgoing edges incident to node
Throws:
java.lang.IllegalArgumentException - if node is null, or if node is not legal in the graph.

getSuccessors

NodeIterable getSuccessors(Node node)
Returns node's successors. A successor of node is a node which is connected to node by an outgoing edge going from node.

Parameters:
node - the node whose successors are to be returned
Returns:
a node iterable of node's successors
Throws:
java.lang.IllegalArgumentException - if node is null, or if node is not legal in the graph.

getPredecessors

NodeIterable getPredecessors(Node node)
Returns node's predecessors. A predecessor of node is a node which is connected to node by an incoming edge going to node.

Parameters:
node - the node whose predecessors are to be returned
Returns:
a node iterable of node's successors
Throws:
java.lang.IllegalArgumentException - if node is null, or if node is not legal in the graph.

isSuccessor

boolean isSuccessor(Node node,
                    Node successor)
Returns true if successor is a successor of node.

Warning: This method is not thread safe, be sure to call it in a locked statement.

Parameters:
node - the node which has successor as a successor
successor - the node which has node as a predecessor
Returns:
true if successor is a successor of node
Throws:
java.lang.IllegalArgumentException - if node or successor is null of not legal in the graph

isPredecessor

boolean isPredecessor(Node node,
                      Node predecessor)
Returns true if predecessor is a predecessor of node.

Warning: This method is not thread safe, be sure to call it in a locked statement.

Parameters:
node - the node which has predecessor as a predecessor
predecessor - the node which has node as a successor
Returns:
true if predecessor is a predecessor of node
Throws:
java.lang.IllegalArgumentException - if node or predecessor is null of not legal in the graph

getInDegree

int getInDegree(Node node)
Returns the number of incoming edges incident to node.

Warning: This method is not thread safe, be sure to call it in a locked statement.

Parameters:
node - the node whose indegree is to be returned
Returns:
the number of incoming edges incident to node
Throws:
java.lang.IllegalArgumentException - if node is null of not legal in the graph

getOutDegree

int getOutDegree(Node node)
Returns the number of outgoing edges incident to node.

Warning: This method is not thread safe, be sure to call it in a locked statement.

Parameters:
node - the node whose outdegree is to be returned
Returns:
the number of outgoing edges incident to node
Throws:
java.lang.IllegalArgumentException - if node is null of not legal in the graph

getMutualDegree

int getMutualDegree(Node node)
Returns the number of mutual edges incident to node. Edges are considered mutual when both incoming and outgoing edges exists for a same neighbour. Mutual edges are also called bi-directionnal.

Warning: This method is not thread safe, be sure to call it in a locked statement.

Parameters:
node - the node whose outdegree is to be returned
Returns:
the number of outgoing edges incident to node
Throws:
java.lang.IllegalArgumentException - if node is null of not legal in the graph

Gephi Toolkit Javadoc