Gephi Toolkit Javadoc

org.gephi.graph.api
Interface MixedGraph

All Superinterfaces:
Attributable, Graph
All Known Subinterfaces:
HierarchicalMixedGraph

public interface MixedGraph
extends Graph

Graph that contains both directed and undirected edges.

Author:
Mathieu Bastian
See Also:
GraphModel

Method Summary
 boolean addEdge(Node source, Node target, boolean directed)
          Add to the graph a directed or undirected edge between source and target.
 EdgeIterable getDirectedEdges()
          Returns an edge iterator of directed edges in the graph.
 Edge getEdge(Node node1, Node node2)
          Finds and returns a directed or undirected edge that connects node1 and node2.
 EdgeIterable getUndirectedEdges()
          Returns an edge iterator of directed edges in the graph.
 boolean isDirected(Edge edge)
          Returns true if edge is directed if undirected.
 
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, 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,
                boolean directed)
Add to the graph a directed or undirected edge between source and target. 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
directed - the type of edge to be created
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)
Finds and returns a directed or undirected 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

getDirectedEdges

EdgeIterable getDirectedEdges()
Returns an edge iterator of directed edges in the graph.

Returns:
Returns an edge iterator of directed edges in the graph.

getUndirectedEdges

EdgeIterable getUndirectedEdges()
Returns an edge iterator of directed edges in the graph.

Returns:
Returns an edge iterator of directed edges in the graph.

isDirected

boolean isDirected(Edge edge)
Returns true if edge is directed if undirected.

Specified by:
isDirected in interface Graph
Parameters:
edge - the edge to be queried
Returns:
Returns true if edge is directed if undirected
Throws:
java.lang.IllegalArgumentException - if edge is null

Gephi Toolkit Javadoc