info.aduna.linkmap.graph.impl
Class GraphImpl

java.lang.Object
  extended by info.aduna.linkmap.graph.impl.GraphImpl
All Implemented Interfaces:
Graph

public class GraphImpl
extends Object
implements Graph


Constructor Summary
GraphImpl()
          Create a new, empty GraphImpl.
GraphImpl(Collection<Vertex> vertices, Collection<Edge> edges)
          Create a new GraphImpl, copying the sets of Vertices and Edges from the specified sets.
 
Method Summary
 void add(Edge edge)
           
 void add(Vertex vertex)
           
 void addEdges(Collection<? extends Edge> edges)
           
 void addVertices(Collection<? extends Vertex> vertices)
           
 boolean contains(Edge edge)
          Returns whether this Graph contains the specified Edge.
 boolean contains(Vertex vertex)
          Returns whether this Graph contains the specified Vertex.
 Collection<Graph> getConnectedSubgraphs()
          Returns a set of Graphs containing disjoint subsets of the Vertices and Edges of this Graph, so that within each one of these Graphs there is a path between each pair of Vertices (ignoring directionality) but there are no paths to Vertices from other Graphs.
 Collection<Graph> getConnectedSubgraphs(Collection<Vertex> vertices, Collection<Edge> edges)
          Returns a set of Graphs containing disjoint subsets of the specified Vertices and Edges, so that within each one of these Graphs there is a path between each pair of Vertices (ignoring directionality) but there are no connections to Vertices from other Graphs.
 Collection<Edge> getEdges()
          Returns the set of Edges of this Graph.
 Collection<Vertex> getVertices()
          Returns the set of Vertices of this Graph.
 boolean isEmpty()
          Returns whether this Graph contains no Vertices and Edges.
 String toString()
          Returns a String containing a description of the contents of this Graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphImpl

public GraphImpl()
Create a new, empty GraphImpl.


GraphImpl

public GraphImpl(Collection<Vertex> vertices,
                 Collection<Edge> edges)
Create a new GraphImpl, copying the sets of Vertices and Edges from the specified sets.

Method Detail

add

public void add(Vertex vertex)

addVertices

public void addVertices(Collection<? extends Vertex> vertices)

add

public void add(Edge edge)

addEdges

public void addEdges(Collection<? extends Edge> edges)

getVertices

public Collection<Vertex> getVertices()
Description copied from interface: Graph
Returns the set of Vertices of this Graph.

Specified by:
getVertices in interface Graph

getEdges

public Collection<Edge> getEdges()
Description copied from interface: Graph
Returns the set of Edges of this Graph.

Specified by:
getEdges in interface Graph

isEmpty

public boolean isEmpty()
Description copied from interface: Graph
Returns whether this Graph contains no Vertices and Edges.

Specified by:
isEmpty in interface Graph

contains

public boolean contains(Vertex vertex)
Description copied from interface: Graph
Returns whether this Graph contains the specified Vertex.

Specified by:
contains in interface Graph

contains

public boolean contains(Edge edge)
Description copied from interface: Graph
Returns whether this Graph contains the specified Edge.

Specified by:
contains in interface Graph

getConnectedSubgraphs

public Collection<Graph> getConnectedSubgraphs()
Description copied from interface: Graph
Returns a set of Graphs containing disjoint subsets of the Vertices and Edges of this Graph, so that within each one of these Graphs there is a path between each pair of Vertices (ignoring directionality) but there are no paths to Vertices from other Graphs.

Specified by:
getConnectedSubgraphs in interface Graph

getConnectedSubgraphs

public Collection<Graph> getConnectedSubgraphs(Collection<Vertex> vertices,
                                               Collection<Edge> edges)
Description copied from interface: Graph
Returns a set of Graphs containing disjoint subsets of the specified Vertices and Edges, so that within each one of these Graphs there is a path between each pair of Vertices (ignoring directionality) but there are no connections to Vertices from other Graphs.

Specified by:
getConnectedSubgraphs in interface Graph

toString

public String toString()
Returns a String containing a description of the contents of this Graph. Makes use of the toString methods of Vertex and Edge.

Overrides:
toString in class Object


Copyright © 1997-2008 Aduna. All Rights Reserved.