- All Implemented Interfaces:
edu.uci.ics.jung.graph.DirectedGraph<Integer,Long>
, edu.uci.ics.jung.graph.Graph<Integer,Long>
, edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
public class JungAdapter
extends Object
implements edu.uci.ics.jung.graph.DirectedGraph<Integer,Long>
An adapter exposing an
ImmutableGraph
as a
Jung
DirectedGraph
.
Using this adapter it is easy to apply Jung's analysis and visualisation code to immutable graphs.
Edges are just Long
s, and their values are the index of the source node, shifted to the left by
32 bits, OR'd with the index of the target node.
The main method of this class provides a simple way to translate any immutable graph in Pajek format.
-
-
Method Summary
Modifier and Type |
Method |
Description |
boolean |
addEdge(Long e,
Integer y,
Integer arg2) |
|
boolean |
addEdge(Long e,
Integer y,
Integer arg2,
edu.uci.ics.jung.graph.util.EdgeType arg3) |
|
boolean |
addEdge(Long e,
Collection<? extends Integer> y) |
|
boolean |
addEdge(Long e,
Collection<? extends Integer> y,
edu.uci.ics.jung.graph.util.EdgeType arg2) |
|
boolean |
addVertex(Integer x) |
|
boolean |
containsEdge(Long e) |
|
boolean |
containsVertex(Integer x) |
|
int |
degree(Integer x) |
|
Long |
findEdge(Integer x,
Integer y) |
|
Collection<Long> |
findEdgeSet(Integer x,
Integer y) |
|
edu.uci.ics.jung.graph.util.EdgeType |
getDefaultEdgeType() |
|
Integer |
getDest(Long e) |
|
int |
getEdgeCount() |
|
int |
getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType x) |
|
Collection<Long> |
getEdges() |
|
Collection<Long> |
getEdges(edu.uci.ics.jung.graph.util.EdgeType x) |
|
edu.uci.ics.jung.graph.util.EdgeType |
getEdgeType(Long e) |
|
edu.uci.ics.jung.graph.util.Pair<Integer> |
getEndpoints(Long e) |
|
int |
getIncidentCount(Long e) |
|
Collection<Long> |
getIncidentEdges(Integer x) |
|
Collection<Integer> |
getIncidentVertices(Long e) |
|
Collection<Long> |
getInEdges(Integer x) |
|
int |
getNeighborCount(Integer x) |
|
Collection<Integer> |
getNeighbors(Integer x) |
|
Integer |
getOpposite(Integer v,
Long e) |
|
Collection<Long> |
getOutEdges(Integer x) |
|
int |
getPredecessorCount(Integer x) |
|
Collection<Integer> |
getPredecessors(Integer x) |
|
Integer |
getSource(Long e) |
|
int |
getSuccessorCount(Integer x) |
|
Collection<Integer> |
getSuccessors(Integer x) |
|
int |
getVertexCount() |
|
Collection<Integer> |
getVertices() |
|
int |
inDegree(Integer x) |
|
boolean |
isArc(int x,
int y) |
|
boolean |
isDest(Integer v,
Long e) |
|
boolean |
isIncident(Integer x,
Long e) |
|
boolean |
isNeighbor(Integer x,
Integer y) |
|
boolean |
isPredecessor(Integer x,
Integer y) |
|
boolean |
isSource(Integer v,
Long e) |
|
boolean |
isSuccessor(Integer x,
Integer y) |
|
static void |
main(String[] arg) |
|
int |
outDegree(Integer x) |
|
boolean |
removeEdge(Long e) |
|
boolean |
removeVertex(Integer x) |
|
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Details
-
getSource
- Specified by:
getSource
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
- Specified by:
getSource
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getDest
- Specified by:
getDest
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
- Specified by:
getDest
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getEndpoints
public edu.uci.ics.jung.graph.util.Pair<Integer> getEndpoints(
Long e)
- Specified by:
getEndpoints
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
-
getInEdges
- Specified by:
getInEdges
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
- Specified by:
getInEdges
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getOpposite
- Specified by:
getOpposite
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
-
getOutEdges
- Specified by:
getOutEdges
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
- Specified by:
getOutEdges
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getPredecessorCount
public int getPredecessorCount(
Integer x)
- Specified by:
getPredecessorCount
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
-
getPredecessors
- Specified by:
getPredecessors
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
- Specified by:
getPredecessors
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getSuccessorCount
public int getSuccessorCount(
Integer x)
- Specified by:
getSuccessorCount
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
-
getSuccessors
- Specified by:
getSuccessors
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
- Specified by:
getSuccessors
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
inDegree
- Specified by:
inDegree
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
- Specified by:
inDegree
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
isDest
- Specified by:
isDest
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
-
isArc
public boolean isArc(int x,
int y)
-
isPredecessor
- Specified by:
isPredecessor
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
-
isSource
- Specified by:
isSource
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
-
isSuccessor
- Specified by:
isSuccessor
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
-
outDegree
- Specified by:
outDegree
in interface edu.uci.ics.jung.graph.Graph<Integer,Long>
- Specified by:
outDegree
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
containsEdge
public boolean containsEdge(
Long e)
- Specified by:
containsEdge
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
containsVertex
public boolean containsVertex(
Integer x)
- Specified by:
containsVertex
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
degree
- Specified by:
degree
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
findEdge
- Specified by:
findEdge
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
findEdgeSet
- Specified by:
findEdgeSet
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getDefaultEdgeType
public edu.uci.ics.jung.graph.util.EdgeType getDefaultEdgeType()
- Specified by:
getDefaultEdgeType
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getEdgeCount
public int getEdgeCount()
- Specified by:
getEdgeCount
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getEdgeCount
public int getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType x)
- Specified by:
getEdgeCount
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getEdgeType
public edu.uci.ics.jung.graph.util.EdgeType getEdgeType(
Long e)
- Specified by:
getEdgeType
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getEdges
- Specified by:
getEdges
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getEdges
public Collection<Long> getEdges(
edu.uci.ics.jung.graph.util.EdgeType x)
- Specified by:
getEdges
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getIncidentCount
public int getIncidentCount(
Long e)
- Specified by:
getIncidentCount
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getIncidentEdges
- Specified by:
getIncidentEdges
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getIncidentVertices
- Specified by:
getIncidentVertices
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getNeighborCount
public int getNeighborCount(
Integer x)
- Specified by:
getNeighborCount
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getNeighbors
- Specified by:
getNeighbors
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getVertexCount
public int getVertexCount()
- Specified by:
getVertexCount
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
getVertices
- Specified by:
getVertices
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
isIncident
- Specified by:
isIncident
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
isNeighbor
- Specified by:
isNeighbor
in interface edu.uci.ics.jung.graph.Hypergraph<Integer,Long>
-
-
-
-
-
-
-
-