edu.uci.ics.jung.graph.impl
Class AbstractArchetypeGraph

java.lang.Object
  extended byedu.uci.ics.jung.utils.UserData
      extended byedu.uci.ics.jung.graph.impl.AbstractArchetypeGraph
All Implemented Interfaces:
ArchetypeGraph, java.lang.Cloneable, UserDataContainer
Direct Known Subclasses:
AbstractSparseGraph, HypergraphBPG

public abstract class AbstractArchetypeGraph
extends UserData
implements ArchetypeGraph

Author:
jrtom To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments

Nested Class Summary
 
Nested classes inherited from class edu.uci.ics.jung.utils.UserDataContainer
UserDataContainer.CopyAction
 
Field Summary
 
Fields inherited from class edu.uci.ics.jung.utils.UserData
CLONE, REMOVE, SHARED
 
Fields inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph
SUBSET_MANAGER
 
Constructor Summary
AbstractArchetypeGraph()
           
 
Method Summary
 void addListener(GraphEventListener gel, GraphEventType get)
          Tells the graph to add gel as a listener for changes in the graph structure
 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.
 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 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.
 
Methods inherited from class edu.uci.ics.jung.utils.UserData
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph
getEdges, getVertices, removeAllEdges, removeAllVertices, removeEdges, removeVertices
 
Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 

Constructor Detail

AbstractArchetypeGraph

public AbstractArchetypeGraph()
Method Detail

newInstance

public ArchetypeGraph newInstance()
Creates a new empty graph of the same type as this graph, by cloning this graph and then clearing the extraneous fields.

Specified by:
newInstance in interface ArchetypeGraph
Returns:
ArchetypeGraph
See Also:
ArchetypeGraph.newInstance()

toString

public java.lang.String toString()
Returns a human-readable representation of this graph.

Overrides:
toString in class UserData
See Also:
Object.toString()

numVertices

public int numVertices()
Description copied from interface: ArchetypeGraph
Returns the number of vertices in this graph.

Specified by:
numVertices in interface ArchetypeGraph
See Also:
ArchetypeGraph.numVertices()

numEdges

public int numEdges()
Description copied from interface: ArchetypeGraph
Returns the number of edges in this graph.

Specified by:
numEdges in interface ArchetypeGraph
See Also:
ArchetypeGraph.numEdges()

getVertexConstraints

public java.util.Collection getVertexConstraints()
Description copied from interface: ArchetypeGraph
Returns the 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.

Specified by:
getVertexConstraints in interface ArchetypeGraph
See Also:
ArchetypeGraph.getVertexConstraints()

getEdgeConstraints

public java.util.Collection getEdgeConstraints()
Description copied from interface: ArchetypeGraph
Returns the 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.

Specified by:
getEdgeConstraints in interface ArchetypeGraph
See Also:
ArchetypeGraph.getEdgeConstraints()

addListener

public void addListener(GraphEventListener gel,
                        GraphEventType get)
Description copied from interface: ArchetypeGraph
Tells the graph to add gel as a listener for changes in the graph structure

Specified by:
addListener in interface ArchetypeGraph
Parameters:
gel - the graph event listener
get - the type of graph events the listeners wants to listen for
See Also:
ArchetypeGraph.addListener(edu.uci.ics.jung.graph.event.GraphEventListener, edu.uci.ics.jung.graph.event.GraphEventType)

removeListener

public void removeListener(GraphEventListener gel,
                           GraphEventType get)
Description copied from interface: ArchetypeGraph
Tells the graph to remove gel as a listener for changes in the graph structure

Specified by:
removeListener in interface ArchetypeGraph
Parameters:
gel - the graph event listener
get - the type of graph events the listeners wants to not listen for
See Also:
ArchetypeGraph.removeListener(edu.uci.ics.jung.graph.event.GraphEventListener, edu.uci.ics.jung.graph.event.GraphEventType)

copy

public ArchetypeGraph copy()
Creates a replica of this graph. Creates a new instance, then copies all vertices, then all edges, and finally all user data.

Specified by:
copy in interface ArchetypeGraph
See Also:
ArchetypeGraph.copy(), AbstractSparseEdge.copy(ArchetypeGraph), AbstractSparseVertex.copy(ArchetypeGraph)