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_delegate
SUBSET_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, setUserDatum
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEdges, getVertices, removeEdges, removeVertices
addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
protected 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 ArchetypeGraph
ArchetypeGraph.newInstance()
protected void addAllNotInitializers(java.util.Collection targetPredicates, java.util.Collection sourcePredicates)
targetPredicates
- sourcePredicates
- public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int numVertices()
ArchetypeGraph
numVertices
in interface ArchetypeGraph
ArchetypeGraph.numVertices()
public int numEdges()
ArchetypeGraph
numEdges
in interface ArchetypeGraph
ArchetypeGraph.numEdges()
public java.util.Collection getVertexConstraints()
ArchetypeGraph
Collection
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 ArchetypeGraph
ArchetypeGraph.getVertexConstraints()
public java.util.Collection getEdgeConstraints()
ArchetypeGraph
Collection
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 ArchetypeGraph
ArchetypeGraph.getEdgeConstraints()
public void addListener(GraphEventListener gel, GraphEventType get)
ArchetypeGraph
addListener
in interface ArchetypeGraph
gel
- 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)
ArchetypeGraph
removeListener
in interface ArchetypeGraph
gel
- 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 ArchetypeGraph
ArchetypeGraph.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 ArchetypeGraph
ArchetypeGraph.removeAllVertices()
public void removeAllEdges()
removeEdge
on all edges of this graph.removeAllEdges
in interface ArchetypeGraph
ArchetypeGraph.removeAllEdges()