public interface Graph extends ArchetypeGraph
ArchetypeGraph
which consists of
a Vertex
set and an Edge
set.
Instances of Graph
may contain either directed or undirected
edges, but not both.UserDataContainer.CopyAction
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.collections.Predicate |
DIRECTED_EDGE |
static org.apache.commons.collections.Predicate |
NOT_PARALLEL_EDGE |
static org.apache.commons.collections.Predicate |
SIMPLE_EDGE |
static org.apache.commons.collections.Predicate |
UNDIRECTED_EDGE |
SUBSET_MANAGER
Modifier and Type | Method and Description |
---|---|
Edge |
addEdge(Edge e)
Adds
e to this graph, and returns a reference to the
added vertex. |
Vertex |
addVertex(Vertex v)
Adds
v to this graph, and returns a reference to the
added vertex. |
boolean |
isDirected()
Deprecated.
As of version 1.4, replaced by
edu.uci.ics.jung.graph.utils.PredicateUtils#enforcesDirected(Graph)
and edu.uci.ics.jung.graph.utils.PredicateUtils#enforcesUndirected(Graph) . |
void |
removeEdge(Edge e)
Removes
e from this graph. |
void |
removeVertex(Vertex v)
Removes
v from this graph. |
addListener, copy, getEdgeConstraints, getEdges, getVertexConstraints, getVertices, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeEdges, removeListener, removeVertices
addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
static final org.apache.commons.collections.Predicate DIRECTED_EDGE
static final org.apache.commons.collections.Predicate UNDIRECTED_EDGE
static final org.apache.commons.collections.Predicate NOT_PARALLEL_EDGE
static final org.apache.commons.collections.Predicate SIMPLE_EDGE
boolean isDirected()
edu.uci.ics.jung.graph.utils.PredicateUtils#enforcesDirected(Graph)
and edu.uci.ics.jung.graph.utils.PredicateUtils#enforcesUndirected(Graph)
.true
if each edge of this graph is directed,
and false
if each edge of this graph is undirected.
If some edges are directed and some are not, throws
FatalException
.Vertex addVertex(Vertex v)
v
to this graph, and returns a reference to the
added vertex.v
- the vertex to be addedEdge addEdge(Edge e)
e
to this graph, and returns a reference to the
added vertex.e
- the edge to be addedvoid removeVertex(Vertex v)
v
from this graph. Any edges incident to
v
which become ill-formed (as defined in the documentation
for ArchetypeEdge
)
as a result of removing v
are also removed from this graph. Throws
IllegalArgumentException
if v
is not
in this graph.void removeEdge(Edge e)
e
from this graph. Throws
IllegalArgumentException
if e
is not
in this graph.