Gephi Toolkit Javadoc

org.gephi.graph.api
Interface UndirectedGraph

All Superinterfaces:
Attributable, Graph
All Known Subinterfaces:
HierarchicalUndirectedGraph

public interface UndirectedGraph
extends Graph

Graph with only undirected edges. Note that undirected graph can be obtained even if all edges are directed. The graph is just taking care to ignore opposite edges.

Author:
Mathieu Bastian
See Also:
GraphModel

Method Summary
 boolean addEdge(Node node1, Node node2)
          Add an undirected edge betweennode1 and node2to the graph.
 Edge getEdge(Node node1, Node node2)
          Find and returns an edge that connects node1 and node2.
 
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 node1,
                Node node2)
Add an undirected edge betweennode1 and node2to the graph. Graph does not accept parallel edges. Fails if a such edge already exists in the graph.

Parameters:
node1 - the first node
node2 - the second 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 node1,
             Node node2)
Find and returns an edge that connects node1 and node2. 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:
node1 - the first incident node of the queried edge
node2 - thge second incident node of the queried edge
Returns:
an edge that connects node1 and node2 or null if no such edge exists
Throws:
java.lang.IllegalArgumentException - if node1 or node2 is null or not legal nodes in the graph

Gephi Toolkit Javadoc