Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.uci.ics.jung.graph
Interface ArchetypeGraph

All Superinterfaces:
  Cloneable, UserDataContainer

All Known Subinterfaces:
  DirectedGraph, Graph, Hypergraph, KPartiteGraph, UndirectedGraph

All Known Implementing Classes:
  AbstractArchetypeGraph, AbstractSparseGraph, DirectedSparseGraph, HypergraphBPG, KPartiteSparseGraph, SetHypergraph, SparseTree, UndirectedSparseGraph

public interface ArchetypeGraph
extends UserDataContainer

A generalized graph which consists of an `ArchetypeVertex` set and an `ArchetypeEdge` set.

This interface permits, but does not enforce, any of the following common variations of graphs:

- binary edges (edges which connect exactly two vertices)
- hyperedges (edges which connect one or more vertices)
- directed and undirected edges
- vertices and edges with attributes (for example, weighted edges)
- vertices and edges of different types (for example, bipartite or multimodal graphs)
- parallel edges (multiple edges which connect a single set of vertices)
- representations as matrices or as adjacency lists

Extensions or implementations of `ArchetypeGraph` may enforce or disallow any or all of these variations.

A graph consists of a set of vertices, and a set of edges. Each edge connects a set of vertices. For details on the process of adding vertices and edges to a graph, see the documentation for `ArchetypeVertex` and `ArchetypeEdge`.

The implementations of the graph, vertex and edge classes are responsible for ensuring that their individual bookkeeping information is kept mutually consistent. (For instance, a sparse graph implementation may have separate references to a single edge stored in each of its incident vertices and in the graph itself. If the edge is removed from the graph, each of these references must also be removed to maintain consistency.)

Author:
  Danyel Fisher, Joshua O'Madadhain, Scott White
See Also:
  `ArchetypeEdge`, `ArchetypeVertex`

Nested Class Summary

Nested classes inherited from class edu.uci.ics.jung.utils.UserDataContainer
`UserDataContainer.CopyAction`

Field Summary
`static String` | `SUBSET_MANAGER`

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()` Performs a deep copy of the graph and its contents.
`Collection` | `getEdgeConstraints()` Returns the `Collection` of requirements that each edge must satisfy when it is added to this graph.
`Set` | `getEdges()` Returns a Set view of all edges in this graph.
`Collection` | `getVertexConstraints()` Returns the `Collection` of constraints that each vertex must satisfy when it is added to this graph.
`Set` | `getVertices()` Returns a Set view of all vertices in this graph.
`ArchetypeGraph` | `newInstance()` Returns a graph of the same type as the graph on which this method is invoked.
`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, leaving the vertices intact.
`void` | `removeAllVertices()` Removes all vertices (and, therefore, edges) from this graph.
`void` | `removeEdges(Set edges)` Deprecated. As of version 1.7, replaced by `GraphUtils.removeEdges(graph, edges)`.
`void` | `removeListener(GraphEventListener gel, GraphEventType get)` Tells the graph to remove gel as a listener for changes in the graph structure
`void` | `removeVertices(Set vertices)` Deprecated. As of version 1.7, replaced by `GraphUtils.removeVertices(graph, vertices)`.

Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer
`addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum`

Field Detail

### SUBSET_MANAGER

    public static final String SUBSET_MANAGER

See Also:
  Constant Field Values

Method Detail

### newInstance

    public ArchetypeGraph newInstance()

  Returns a graph of the same type as the graph on which this method is invoked.

  Returns:
    ArchetypeGraph

### getVertices

    public Set getVertices()

  Returns a Set view of all vertices in this graph. In general, this obeys the java.util.Set contract, and therefore makes no guarantees about the ordering of the vertices within the set.

### getEdges

    public Set getEdges()

  Returns a Set view of all edges in this graph. In general, this obeys the java.util.Set contract, and therefore makes no guarantees about the ordering of the edges within the set.

### numVertices

    public int numVertices()

  Returns the number of vertices in this graph.

### numEdges

    public int numEdges()

  Returns the number of edges in this graph.

### removeVertices

    public void removeVertices(Set vertices)

  Deprecated. As of version 1.7, replaced by `GraphUtils.removeVertices(graph, vertices)`.

  Removes all elements of `vertices` from this graph. If any element of `vertices` is not part of this graph, then throws `IllegalArgumentException`. If this exception is thrown, any vertices that may have been removed already are not guaranteed to be restored to the graph. Prunes any resultant ill-formed edges.

  Parameters:
    `vertices` - the set of vertices to be removed

### removeEdges

    public void removeEdges(Set edges)

  Deprecated. As of version 1.7, replaced by `GraphUtils.removeEdges(graph, edges)`.

  Removes all elements of `edges` from this graph. If any element of `edges` is not part of this graph, then throws `IllegalArgumentException`. If this exception is thrown, any edges that may have been removed already are not guaranteed to be restored to the graph.

### removeAllEdges

    public void removeAllEdges()

  Removes all edges from this graph, leaving the vertices intact. Equivalent to `removeEdges(getEdges())`.

### removeAllVertices

    public void removeAllVertices()

  Removes all vertices (and, therefore, edges) from this graph. Equivalent to `removeVertices(getVertices())`.

### copy

    public ArchetypeGraph copy()

  Performs a deep copy of the graph and its contents.

### addListener

    public void addListener(GraphEventListener gel,
                            GraphEventType get)

  Tells the graph to add gel as a listener for changes in the graph structure

  Parameters:
    `gel` - the graph event listener
    `get` - the type of graph events the listeners wants to listen for

### removeListener

    public void removeListener(GraphEventListener gel,
                               GraphEventType get)

  Tells the graph to remove gel as a listener for changes in the graph structure

  Parameters:
    `gel` - the graph event listener
    `get` - the type of graph events the listeners wants to not listen for

### getVertexConstraints

    public Collection getVertexConstraints()

  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.

### getEdgeConstraints

    public Collection getEdgeConstraints()

  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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD