public abstract class AbstractArchetypeGraph extends UserDataDelegate implements ArchetypeGraph, java.lang.Cloneable
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractArchetypeGraph.Requirements |
UserDataContainer.CopyAction| Modifier and Type | Field and Description |
|---|---|
protected AbstractArchetypeGraph.Requirements |
edge_requirements |
protected java.util.Map |
mEdgeIDs
ID -> Edge lookup table.
|
protected GraphListenerHandler |
mGraphListenerHandler
GraphEventType -> Graph Listener list table
|
protected java.util.Map |
mVertexIDs
ID -> Vertex lookup table.
|
protected AbstractArchetypeGraph.Requirements |
vertex_requirements |
factory, udc_delegateSUBSET_MANAGER| Constructor and Description |
|---|
AbstractArchetypeGraph() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAllNotInitializers(java.util.Collection targetPredicates,
java.util.Collection sourcePredicates)
Adds all the predicates in source to the list in target, except those
that answer to isInitializationPredicate.
|
void |
addListener(GraphEventListener gel,
GraphEventType get)
Tells the graph to add gel as a listener for changes in the graph structure
|
protected void |
checkConstraints(java.lang.Object o,
java.util.Collection c) |
ArchetypeGraph |
copy()
Creates a replica of this graph.
|
java.util.Collection |
getEdgeConstraints()
Returns the
Collection of requirements that each edge
must satisfy when it is added to this graph. |
java.util.Collection |
getVertexConstraints()
Returns the
Collection of constraints that each vertex
must satisfy when it is added to this graph. |
protected void |
initialize()
Initializes all of the graph's internal data structures.
|
protected boolean |
listenersExist(GraphEventType type) |
ArchetypeGraph |
newInstance()
Creates a new empty graph of the same type as this graph, by cloning this
graph and then clearing the extraneous fields.
|
int |
numEdges()
Returns the number of edges in this graph.
|
int |
numVertices()
Returns the number of vertices in this graph.
|
void |
removeAllEdges()
Removes all edges from this graph.
|
void |
removeAllVertices()
Removes all vertices (and, therefore, all edges) from this graph.
|
void |
removeListener(GraphEventListener gel,
GraphEventType get)
Tells the graph to remove gel as a listener for changes in the graph structure
|
java.lang.String |
toString()
Returns a human-readable representation of this graph.
|
addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDataFactory, setUserDatumequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetEdges, getVertices, removeEdges, removeVerticesaddUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatumprotected GraphListenerHandler mGraphListenerHandler
protected java.util.Map mVertexIDs
protected java.util.Map mEdgeIDs
protected AbstractArchetypeGraph.Requirements edge_requirements
protected AbstractArchetypeGraph.Requirements vertex_requirements
protected void initialize()
Note: this method is not a substitute for
removeAllVertices(), as it will not notify the vertices
and edges that they have been removed from the graph.
public ArchetypeGraph newInstance()
newInstance in interface ArchetypeGraphArchetypeGraph.newInstance()protected void addAllNotInitializers(java.util.Collection targetPredicates,
java.util.Collection sourcePredicates)
targetPredicates - sourcePredicates - public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public int numVertices()
ArchetypeGraphnumVertices in interface ArchetypeGraphArchetypeGraph.numVertices()public int numEdges()
ArchetypeGraphnumEdges in interface ArchetypeGraphArchetypeGraph.numEdges()public java.util.Collection getVertexConstraints()
ArchetypeGraphCollection of constraints that each vertex
must satisfy when it is added to this graph. This collection may
be viewed and modified by the user to add or remove constraints.getVertexConstraints in interface ArchetypeGraphArchetypeGraph.getVertexConstraints()public java.util.Collection getEdgeConstraints()
ArchetypeGraphCollection of requirements that each edge
must satisfy when it is added to this graph. This collection may
be viewed and modified by the user to add or remove requirements.getEdgeConstraints in interface ArchetypeGraphArchetypeGraph.getEdgeConstraints()public void addListener(GraphEventListener gel, GraphEventType get)
ArchetypeGraphaddListener in interface ArchetypeGraphgel - the graph event listenerget - the type of graph events the listeners wants to listen forArchetypeGraph.addListener(edu.uci.ics.jung.graph.event.GraphEventListener,
edu.uci.ics.jung.graph.event.GraphEventType)public void removeListener(GraphEventListener gel, GraphEventType get)
ArchetypeGraphremoveListener in interface ArchetypeGraphgel - the graph event listenerget - the type of graph events the listeners wants to not listen forArchetypeGraph.removeListener(edu.uci.ics.jung.graph.event.GraphEventListener,
edu.uci.ics.jung.graph.event.GraphEventType)protected boolean listenersExist(GraphEventType type)
public ArchetypeGraph copy()
copy in interface ArchetypeGraphArchetypeGraph.copy(),
AbstractSparseEdge.copy(ArchetypeGraph),
AbstractSparseVertex.copy(ArchetypeGraph)protected void checkConstraints(java.lang.Object o,
java.util.Collection c)
public void removeAllVertices()
removeVertex on all
vertices of this graph.removeAllVertices in interface ArchetypeGraphArchetypeGraph.removeAllVertices()public void removeAllEdges()
removeEdge on all edges of this graph.removeAllEdges in interface ArchetypeGraphArchetypeGraph.removeAllEdges()