public class JungLib extends GraphLibrary<StdVertex,StdEdge>
Modifier and Type | Field and Description |
---|---|
static JungEdgeFactory |
edgeFactory |
static JungWeightTransformer |
edgeTransformer |
protected edu.uci.ics.jung.graph.Graph<StdVertex,StdEdge> |
graph |
DEFAULTDIRECTED, DEFAULTFORCELOOPFREE, DEFAULTWEIGHTED, directed, graphCreated, SET_STATUS, weighted
Constructor and Description |
---|
JungLib() |
Modifier and Type | Method and Description |
---|---|
static JungLib |
createFromJUNG2Graph(edu.uci.ics.jung.graph.Graph<?,?> graph) |
protected StdEdge |
derivAddEdge(StdVertex vertex1,
StdVertex vertex2)
Must create an edge and add it to the internal graph.
|
protected StdVertex |
derivAddVertex()
Must create a vertex and add it to the internal graph.
|
protected void |
derivCopyFromExistingGraph(java.lang.Object graph,
GraphLibrary<?,?> target)
Copies the contents of the given graph instance into the given graph
library.
|
protected void |
derivCreateGraph(boolean directed,
boolean weighted,
boolean forceLoopFree)
Must create the internal graph with the given COnfiguration.
|
protected double |
derivGetEdgeWeight(StdEdge edge)
Returns the weight of the given edge.
|
StdVertex |
derivGetEndVertex(StdEdge edge)
Returns the end point of the given edge.
|
StdVertex |
derivGetStartVertex(StdEdge edge)
Returns the start point of the given edge.
|
protected void |
derivRemoveEdge(StdEdge edge)
Removes the given edge from the internal graph
|
protected void |
derivRemoveVertex(StdVertex vertex)
Removes the given vertex from the internal graph.
|
protected void |
derivSetEdgeWeight(StdEdge edge,
double weight)
Sets the given weight as the weight of the given edge.
|
void |
derivSetVertexIdent(StdVertex vertex,
java.lang.String ident)
Changes the identifier of the given vertex.
|
protected GraphConfiguration |
getDefaultGraphConfiguration()
Returns a GraphConfiguration which is working with the respective graph.
|
StdEdge |
getEdge(StdVertex vertex1,
StdVertex vertex2)
Returns the edge which contains the given vertices.
|
int |
getEdgeCount() |
java.lang.Object |
getEdgeData(StdEdge edge)
Returns the data of the given edge.
|
java.lang.String |
getEdgeName(edu.uci.ics.jung.algorithms.filters.KNeighborhoodFilter.EdgeType edge) |
java.lang.Iterable<StdEdge> |
getEdges() |
java.lang.Object |
getEdgeStatus(StdEdge edge)
Returns the status of the given edge in O(1).
|
int |
getIngoingEdgeCount(StdVertex vertex)
Returns the amount of ingoing edges of the given vertex.
|
java.lang.Iterable<StdEdge> |
getIngoingEdges(StdVertex vertex)
Returns all ingoing edges of the given vertex.
|
edu.uci.ics.jung.graph.Graph<StdVertex,StdEdge> |
getInternalGraph()
Returns the internal graph.
|
java.lang.String |
getLibName()
Returns the (constant) name of the graph library.
|
java.lang.Iterable<StdVertex> |
getNeighbors(StdVertex vertex)
Makes it possible to iterate over the neighbors of the given vertex.
|
int |
getOutgoingEdgeCount(StdVertex vertex)
Returns the amount of outgoing edges of the given vertex.
|
java.lang.Iterable<StdEdge> |
getOutgoingEdges(StdVertex vertex)
Returns all outgoing edges of the given vertex.
|
int |
getVertexCount() |
java.lang.Object |
getVertexData(StdVertex vertex)
Returns the data of the given vertex.
|
java.lang.String |
getVertexIdent(StdVertex vertex)
Returns the identifier of the given vertex.
|
java.lang.Object |
getVertexStatus(StdVertex vertex)
Returns the status of the given vertex in O(1).
|
java.lang.Iterable<StdVertex> |
getVertices() |
void |
setEdgeData(StdEdge edge,
java.lang.Object data)
Sets the data of the given edge.
|
void |
setEdgeStatus(StdEdge edge,
java.lang.Object status)
Sets the status of the given edge in O(1).
|
void |
setVertexData(StdVertex vertex,
java.lang.Object data)
Sets the data of the given vertex.
|
void |
setVertexStatus(StdVertex vertex,
java.lang.Object status)
Sets the status of the given vertex in O(1).
|
protected boolean |
supportsCopyFromExistingGraph()
Returns true, iff this GraphLibrary sub class supports creating graphs
from existing graph instances.
|
static <SVertexType,SEdgeType> |
toJungGraph(GraphLibrary<SVertexType,SEdgeType> graph) |
static <SVertexType,SEdgeType> |
toJungGraph(GraphLibrary<SVertexType,SEdgeType> graph,
boolean deepCopy) |
java.awt.Component |
visualizeGraph(java.lang.String layoutKey,
int width,
int height) |
addEdge, addEdge, addEdge, addEdgeByIdent, addGraphListener, addVertex, addVertex, addVertex, addVertex, asConfigurated, checkPrefaceGraph, clearAlgorithmResults, clearDates, clearEdgeData, clearEdgeDates, clearEdgeStates, clearEdgeStatus, clearGraph, clearStates, clearVertexData, clearVertexDates, clearVertexStates, clearVertexStatus, copyFromExistingGraph, copyFromExistingGraph, copyToGraph, copyToGraph, copyToGraph, createDefaultGraph, createGraph, createGraph, createGraph, createGraph, createGraphUnchecked, createGraphUnchecked, createMetaEdge, deleteLoops, deleteWarning, edgeExists, edgeExistsByIdent, edgesToString, edgeToString, enableLoops, forceLoopFree, getAlgorithmResult, getAverageDegree, getEdgeByIdent, getEdgeName, getEdgeWeight, getEdgeWeight, getEdgeWeightByIdent, getEndVertex, getEndVertex, getGraphId, getIncidentEdges, getMarkedEdgeCount, getMarkedVertexCount, getMaximumDegree, getMinimumDegree, getName, getNeighborCount, getNextVertexIdentifier, getStartVertex, getUnmarkedNeighborCount, getVertexByIdent, getVertexByIdent, getVertexIdentUnchecked, getVertexStdPrefix, getVisualElements, graphModified, hasAlgorithmResult, hasEdgeData, hasVertexData, isDirected, isEdgeMarkedAsDeleted, isEdgeStatusSet, isEmpty, isForceLoopFree, isGraphCreated, isLoopFree, isVertexMarkedAsDeleted, isVertexStatusSet, isWeighted, markEdgeAsDeleted, markVertexAsDeleted, mergeGraph, metaEdgeToString, pollWarning, prepareAlgorithmRun, printWarning, putWarning, refresh, removeAlgorithmResult, removeEdge, removeEdge, removeEdge, removeEdgeDeletionMark, removeGraphListener, removeVertex, removeVertex, removeVertexDeletionMark, resolveVertexName, setAlgorithmResult, setBlockCacheOutput, setDirected, setEdgeDates, setEdgeStates, setEdgeWeight, setName, setVertexDates, setVertexIdent, setVertexStates, setVertexStatus, setVertexStdPrefix, toString, vertexExistsByIdent, vertexToString, verticesToString
public static final JungWeightTransformer edgeTransformer
public static final JungEdgeFactory edgeFactory
public static <SVertexType,SEdgeType> edu.uci.ics.jung.graph.Graph<StdVertex,StdEdge> toJungGraph(GraphLibrary<SVertexType,SEdgeType> graph, boolean deepCopy)
public static <SVertexType,SEdgeType> edu.uci.ics.jung.graph.Graph<StdVertex,StdEdge> toJungGraph(GraphLibrary<SVertexType,SEdgeType> graph)
public static JungLib createFromJUNG2Graph(edu.uci.ics.jung.graph.Graph<?,?> graph) throws InvalidGraphException
InvalidGraphException
public java.lang.Iterable<StdVertex> getVertices()
getVertices
in class GraphLibrary<StdVertex,StdEdge>
public java.lang.Iterable<StdEdge> getEdges()
getEdges
in class GraphLibrary<StdVertex,StdEdge>
protected StdEdge derivAddEdge(StdVertex vertex1, StdVertex vertex2)
GraphLibrary
derivAddEdge
in class GraphLibrary<StdVertex,StdEdge>
vertex1
- The first endpoint.vertex2
- The second endpoint.protected StdVertex derivAddVertex()
GraphLibrary
derivAddVertex
in class GraphLibrary<StdVertex,StdEdge>
protected void derivCreateGraph(boolean directed, boolean weighted, boolean forceLoopFree)
GraphLibrary
derivCreateGraph
in class GraphLibrary<StdVertex,StdEdge>
directed
- Determines, whether the graph shall be directed.weighted
- Determines, whether the graph shall be weighted.forceLoopFree
- Determines, whether it is impossible to add loops into the
graphpublic int getEdgeCount()
getEdgeCount
in class GraphLibrary<StdVertex,StdEdge>
public int getVertexCount()
getVertexCount
in class GraphLibrary<StdVertex,StdEdge>
public StdVertex derivGetStartVertex(StdEdge edge)
GraphLibrary
derivGetStartVertex
in class GraphLibrary<StdVertex,StdEdge>
public StdVertex derivGetEndVertex(StdEdge edge)
GraphLibrary
derivGetEndVertex
in class GraphLibrary<StdVertex,StdEdge>
public java.lang.String getLibName()
GraphLibrary
getLibName
in class GraphLibrary<StdVertex,StdEdge>
public edu.uci.ics.jung.graph.Graph<StdVertex,StdEdge> getInternalGraph()
GraphLibrary
getInternalGraph
in class GraphLibrary<StdVertex,StdEdge>
protected double derivGetEdgeWeight(StdEdge edge)
GraphLibrary
derivGetEdgeWeight
in class GraphLibrary<StdVertex,StdEdge>
protected void derivSetEdgeWeight(StdEdge edge, double weight)
GraphLibrary
derivSetEdgeWeight
in class GraphLibrary<StdVertex,StdEdge>
public int getIngoingEdgeCount(StdVertex vertex)
GraphLibrary
getIngoingEdgeCount
in class GraphLibrary<StdVertex,StdEdge>
public java.lang.Iterable<StdEdge> getIngoingEdges(StdVertex vertex)
GraphLibrary
getIngoingEdges
in class GraphLibrary<StdVertex,StdEdge>
public int getOutgoingEdgeCount(StdVertex vertex)
GraphLibrary
getOutgoingEdgeCount
in class GraphLibrary<StdVertex,StdEdge>
public java.lang.Iterable<StdEdge> getOutgoingEdges(StdVertex vertex)
GraphLibrary
getOutgoingEdges
in class GraphLibrary<StdVertex,StdEdge>
protected void derivRemoveVertex(StdVertex vertex)
GraphLibrary
derivRemoveVertex
in class GraphLibrary<StdVertex,StdEdge>
vertex
- The vertex which shall be removedprotected void derivRemoveEdge(StdEdge edge)
GraphLibrary
derivRemoveEdge
in class GraphLibrary<StdVertex,StdEdge>
edge
- The edge which shall be removedpublic StdEdge getEdge(StdVertex vertex1, StdVertex vertex2)
GraphLibrary
getEdge
in class GraphLibrary<StdVertex,StdEdge>
vertex1
- The first vertex (start point if the graph is directed)vertex2
- The second vertex (end point if the graph is directed)public java.lang.String getVertexIdent(StdVertex vertex)
GraphLibrary
getVertexIdent
in class GraphLibrary<StdVertex,StdEdge>
vertex
- The vertex its identifier shall be returnedpublic void derivSetVertexIdent(StdVertex vertex, java.lang.String ident)
GraphLibrary
derivSetVertexIdent
in class GraphLibrary<StdVertex,StdEdge>
vertex
- The vertex its identifier shall be setident
- The new identifierpublic java.lang.Object getVertexStatus(StdVertex vertex)
GraphLibrary
getVertexStatus
in class GraphLibrary<StdVertex,StdEdge>
vertex
- the vertex.public void setVertexStatus(StdVertex vertex, java.lang.Object status)
GraphLibrary
setVertexStatus
in class GraphLibrary<StdVertex,StdEdge>
vertex
- the vertex of which the status shall be set.status
- the new status to set.public java.lang.Object getEdgeStatus(StdEdge edge)
GraphLibrary
getEdgeStatus
in class GraphLibrary<StdVertex,StdEdge>
edge
- the edge.public void setEdgeStatus(StdEdge edge, java.lang.Object status)
GraphLibrary
setEdgeStatus
in class GraphLibrary<StdVertex,StdEdge>
edge
- the edge of which the status shall be set.status
- the new status to set.public java.lang.Iterable<StdVertex> getNeighbors(StdVertex vertex)
GraphLibrary
getNeighbors
in class GraphLibrary<StdVertex,StdEdge>
vertex
- the vertex.public java.lang.String getEdgeName(edu.uci.ics.jung.algorithms.filters.KNeighborhoodFilter.EdgeType edge)
public java.awt.Component visualizeGraph(java.lang.String layoutKey, int width, int height)
public java.lang.Object getEdgeData(StdEdge edge)
GraphLibrary
getEdgeData
in class GraphLibrary<StdVertex,StdEdge>
edge
- the edge.public java.lang.Object getVertexData(StdVertex vertex)
GraphLibrary
getVertexData
in class GraphLibrary<StdVertex,StdEdge>
vertex
- the vertex.public void setEdgeData(StdEdge edge, java.lang.Object data)
GraphLibrary
setEdgeData
in class GraphLibrary<StdVertex,StdEdge>
edge
- the edge of which the data shall be set.data
- the new data.public void setVertexData(StdVertex vertex, java.lang.Object data)
GraphLibrary
setVertexData
in class GraphLibrary<StdVertex,StdEdge>
vertex
- the vertex of which thee status shall be set.data
- the new data to set.protected GraphConfiguration getDefaultGraphConfiguration()
GraphLibrary
getDefaultGraphConfiguration
in class GraphLibrary<StdVertex,StdEdge>
protected void derivCopyFromExistingGraph(java.lang.Object graph, GraphLibrary<?,?> target) throws InvalidGraphException, InvalidGraphConfigException
GraphLibrary
derivCopyFromExistingGraph
in class GraphLibrary<StdVertex,StdEdge>
graph
- the graph instance of the respective graph library.target
- the target GraphLibrary to copy to.InvalidGraphException
- if the given object is not a valid graph instance of the
graph library.InvalidGraphConfigException
- if the graph library can not handle the configuration of the
given graph instance.protected boolean supportsCopyFromExistingGraph()
GraphLibrary
supportsCopyFromExistingGraph
in class GraphLibrary<StdVertex,StdEdge>