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

java.lang.Object
  extended byedu.uci.ics.jung.utils.UserData
      extended byedu.uci.ics.jung.graph.impl.AbstractArchetypeGraph
          extended byedu.uci.ics.jung.graph.impl.AbstractSparseGraph
              extended byedu.uci.ics.jung.graph.impl.SparseGraph
                  extended byedu.uci.ics.jung.graph.impl.KPartiteSparseGraph
All Implemented Interfaces:
ArchetypeGraph, java.lang.Cloneable, Graph, KPartiteGraph, UserDataContainer

public class KPartiteSparseGraph
extends SparseGraph
implements KPartiteGraph

An implementation of KPartiteGraph based on SparseGraph. This implementation optionally creates a subset for each partition specified in the constructor.

Author:
Joshua O'Madadhain

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.Graph
DIRECTED_EDGE, NOT_PARALLEL_EDGE, SIMPLE_EDGE, UNDIRECTED_EDGE
 
Fields inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph
SUBSET_MANAGER
 
Constructor Summary
KPartiteSparseGraph(java.util.Collection partitions, boolean subsets)
          Creates a KPartiteSparseGraph whose partitions are specified by the predicates in the partitions array.
KPartiteSparseGraph(Graph g, java.util.Collection partitions, boolean subsets)
           Creates a new KPartiteSparseGraph which contains all the vertices and edges in g.
 
Method Summary
 java.util.Collection getPartitions()
          Returns the array of predicates which define the partitions of this graph.
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractSparseGraph
addEdge, addVertex, getEdges, getVertices, isDirected, removeAllEdges, removeAllVertices, removeEdge, removeEdges, removeVertex, removeVertices
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractArchetypeGraph
addListener, copy, getEdgeConstraints, getVertexConstraints, newInstance, numEdges, numVertices, removeListener, toString
 
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.Graph
addEdge, addVertex, isDirected, removeEdge, removeVertex
 
Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph
addListener, copy, getEdgeConstraints, getEdges, getVertexConstraints, getVertices, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeEdges, removeListener, removeVertices
 
Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 

Constructor Detail

KPartiteSparseGraph

public KPartiteSparseGraph(java.util.Collection partitions,
                           boolean subsets)
Creates a KPartiteSparseGraph whose partitions are specified by the predicates in the partitions array. If the subsets argument is true, creates a subset for each partition.


KPartiteSparseGraph

public KPartiteSparseGraph(Graph g,
                           java.util.Collection partitions,
                           boolean subsets)

Creates a new KPartiteSparseGraph which contains all the vertices and edges in g. The new graph contains all the user data from the original graph and its components.

This method performs no tagging or structural conversion. If g is not compatible with the constraints specified by partitions, this constructor will throw an IllegalArgumentException. Thus, each vertex in g must be a member of exactly one partition, and each edge must join vertices in distinct partitions.

Method Detail

getPartitions

public java.util.Collection getPartitions()
Description copied from interface: KPartiteGraph
Returns the array of predicates which define the partitions of this graph.

Specified by:
getPartitions in interface KPartiteGraph