public class JGraphTLib extends GraphLibrary<StdVertex,JGraphTWeightedEdge>
DEFAULTDIRECTED, DEFAULTFORCELOOPFREE, DEFAULTWEIGHTED, directed, graphCreated, SET_STATUS, weighted| Constructor and Description |
|---|
JGraphTLib() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkPrefaceGraph(boolean directed,
boolean weighted,
boolean forceLoopFree,
GraphLibrary<?,?> preface)
Checks whether or not this graph library would be able to create a graph
which is equivalent to the given graph.
|
static JGraphTLib |
createFromJGraphTGraph(org.jgrapht.Graph<?,?> graph)
Creates a JGraphTLib by copying the contents of the given JGraphT graph instance
|
JGraphTWeightedEdge |
derivAddEdge(StdVertex vertex1,
StdVertex vertex2)
Must create an edge and add it to the internal graph.
|
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(JGraphTWeightedEdge edge)
Returns the weight of the given edge.
|
StdVertex |
derivGetEndVertex(JGraphTWeightedEdge edge)
Returns the end point of the given edge.
|
StdVertex |
derivGetStartVertex(JGraphTWeightedEdge edge)
Returns the start point of the given edge.
|
protected void |
derivRemoveEdge(JGraphTWeightedEdge 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(JGraphTWeightedEdge 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.
|
JGraphTWeightedEdge |
getEdge(StdVertex vertex1,
StdVertex vertex2)
Returns the edge which contains the given vertices.
|
int |
getEdgeCount() |
java.lang.Object |
getEdgeData(JGraphTWeightedEdge edge)
Returns the data of the given edge.
|
java.lang.Iterable<JGraphTWeightedEdge> |
getEdges() |
java.lang.Object |
getEdgeStatus(JGraphTWeightedEdge 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<JGraphTWeightedEdge> |
getIngoingEdges(StdVertex vertex)
Returns all ingoing edges of the given vertex.
|
org.jgrapht.graph.AbstractBaseGraph<StdVertex,JGraphTWeightedEdge> |
getInternalGraph()
Returns the internal graph.
|
java.lang.String |
getLibName()
Returns the (constant) name of the graph library.
|
int |
getOutgoingEdgeCount(StdVertex vertex)
Returns the amount of outgoing edges of the given vertex.
|
java.lang.Iterable<JGraphTWeightedEdge> |
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(JGraphTWeightedEdge edge,
java.lang.Object data)
Sets the data of the given edge.
|
void |
setEdgeStatus(JGraphTWeightedEdge 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.
|
addEdge, addEdge, addEdge, addEdgeByIdent, addGraphListener, addVertex, addVertex, addVertex, addVertex, asConfigurated, 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, getNeighbors, 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, verticesToStringpublic static JGraphTLib createFromJGraphTGraph(org.jgrapht.Graph<?,?> graph) throws InvalidGraphException
graph - the graph to copy fromInvalidGraphException - if the graph has unsupported propertiespublic JGraphTWeightedEdge derivAddEdge(StdVertex vertex1, StdVertex vertex2)
GraphLibraryderivAddEdge in class GraphLibrary<StdVertex,JGraphTWeightedEdge>vertex1 - The first endpoint.vertex2 - The second endpoint.public StdVertex derivAddVertex()
GraphLibraryderivAddVertex in class GraphLibrary<StdVertex,JGraphTWeightedEdge>protected void derivCreateGraph(boolean directed,
boolean weighted,
boolean forceLoopFree)
throws InvalidGraphConfigException
GraphLibraryderivCreateGraph in class GraphLibrary<StdVertex,JGraphTWeightedEdge>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
graphInvalidGraphConfigException - If the given configuration is notpublic void checkPrefaceGraph(boolean directed,
boolean weighted,
boolean forceLoopFree,
GraphLibrary<?,?> preface)
throws InvalidGraphConfigException
GraphLibrarycheckPrefaceGraph in class GraphLibrary<StdVertex,JGraphTWeightedEdge>preface - the graph to check.InvalidGraphConfigException - if this graph library is not able to create an equivalent
graph to the given graph.public int getVertexCount()
getVertexCount in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public int getEdgeCount()
getEdgeCount in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public java.lang.Iterable<JGraphTWeightedEdge> getEdges()
getEdges in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public java.lang.String getLibName()
GraphLibrarygetLibName in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public StdVertex derivGetStartVertex(JGraphTWeightedEdge edge)
GraphLibraryderivGetStartVertex in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public StdVertex derivGetEndVertex(JGraphTWeightedEdge edge)
GraphLibraryderivGetEndVertex in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public java.lang.Iterable<StdVertex> getVertices()
getVertices in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public org.jgrapht.graph.AbstractBaseGraph<StdVertex,JGraphTWeightedEdge> getInternalGraph()
GraphLibrarygetInternalGraph in class GraphLibrary<StdVertex,JGraphTWeightedEdge>protected double derivGetEdgeWeight(JGraphTWeightedEdge edge)
GraphLibraryderivGetEdgeWeight in class GraphLibrary<StdVertex,JGraphTWeightedEdge>protected void derivSetEdgeWeight(JGraphTWeightedEdge edge, double weight)
GraphLibraryderivSetEdgeWeight in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public java.lang.Iterable<JGraphTWeightedEdge> getIngoingEdges(StdVertex vertex)
GraphLibrarygetIngoingEdges in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public int getIngoingEdgeCount(StdVertex vertex)
GraphLibrarygetIngoingEdgeCount in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public java.lang.Iterable<JGraphTWeightedEdge> getOutgoingEdges(StdVertex vertex)
GraphLibrarygetOutgoingEdges in class GraphLibrary<StdVertex,JGraphTWeightedEdge>public int getOutgoingEdgeCount(StdVertex vertex)
GraphLibrarygetOutgoingEdgeCount in class GraphLibrary<StdVertex,JGraphTWeightedEdge>protected void derivRemoveVertex(StdVertex vertex)
GraphLibraryderivRemoveVertex in class GraphLibrary<StdVertex,JGraphTWeightedEdge>vertex - The vertex which shall be removedprotected void derivRemoveEdge(JGraphTWeightedEdge edge)
GraphLibraryderivRemoveEdge in class GraphLibrary<StdVertex,JGraphTWeightedEdge>edge - The edge which shall be removedpublic JGraphTWeightedEdge getEdge(StdVertex vertex1, StdVertex vertex2)
GraphLibrarygetEdge in class GraphLibrary<StdVertex,JGraphTWeightedEdge>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)
GraphLibrarygetVertexIdent in class GraphLibrary<StdVertex,JGraphTWeightedEdge>vertex - The vertex its identifier shall be returnedpublic void derivSetVertexIdent(StdVertex vertex, java.lang.String ident)
GraphLibraryderivSetVertexIdent in class GraphLibrary<StdVertex,JGraphTWeightedEdge>vertex - The vertex its identifier shall be setident - The new identifierpublic java.lang.Object getVertexStatus(StdVertex vertex)
GraphLibrarygetVertexStatus in class GraphLibrary<StdVertex,JGraphTWeightedEdge>vertex - the vertex.public void setVertexStatus(StdVertex vertex, java.lang.Object status)
GraphLibrarysetVertexStatus in class GraphLibrary<StdVertex,JGraphTWeightedEdge>vertex - the vertex of which the status shall be set.status - the new status to set.public java.lang.Object getEdgeStatus(JGraphTWeightedEdge edge)
GraphLibrarygetEdgeStatus in class GraphLibrary<StdVertex,JGraphTWeightedEdge>edge - the edge.public void setEdgeStatus(JGraphTWeightedEdge edge, java.lang.Object status)
GraphLibrarysetEdgeStatus in class GraphLibrary<StdVertex,JGraphTWeightedEdge>edge - the edge of which the status shall be set.status - the new status to set.public java.lang.Object getEdgeData(JGraphTWeightedEdge edge)
GraphLibrarygetEdgeData in class GraphLibrary<StdVertex,JGraphTWeightedEdge>edge - the edge.public java.lang.Object getVertexData(StdVertex vertex)
GraphLibrarygetVertexData in class GraphLibrary<StdVertex,JGraphTWeightedEdge>vertex - the vertex.public void setEdgeData(JGraphTWeightedEdge edge, java.lang.Object data)
GraphLibrarysetEdgeData in class GraphLibrary<StdVertex,JGraphTWeightedEdge>edge - the edge of which the data shall be set.data - the new data.public void setVertexData(StdVertex vertex, java.lang.Object data)
GraphLibrarysetVertexData in class GraphLibrary<StdVertex,JGraphTWeightedEdge>vertex - the vertex of which thee status shall be set.data - the new data to set.protected GraphConfiguration getDefaultGraphConfiguration()
GraphLibrarygetDefaultGraphConfiguration in class GraphLibrary<StdVertex,JGraphTWeightedEdge>protected void derivCopyFromExistingGraph(java.lang.Object graph,
GraphLibrary<?,?> target)
throws InvalidGraphException,
InvalidGraphConfigException
GraphLibraryderivCopyFromExistingGraph in class GraphLibrary<StdVertex,JGraphTWeightedEdge>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()
GraphLibrarysupportsCopyFromExistingGraph in class GraphLibrary<StdVertex,JGraphTWeightedEdge>