edu.umd.cs.findbugs.graph

Class AbstractGraph<EdgeType,VertexType>

public abstract class AbstractGraph<EdgeType extends AbstractEdge<EdgeType,VertexType>,VertexType extends AbstractVertex<EdgeType,VertexType>> extends Object implements Graph<EdgeType,VertexType>

A simple Graph implementation where the vertex objects store a list of incoming and outgoing edges. The edge link fields are stored in the edge objects, which means a fairly low space overhead.

The abstract allocateEdge() method must be implemented.

Author: David Hovemeyer

See Also: Graph AbstractEdge AbstractVertex

Constructor Summary
AbstractGraph()
Method Summary
voidaddVertex(VertexType v)
protected abstract EdgeTypeallocateEdge(VertexType source, VertexType target)
booleancontainsVertex(VertexType v)
EdgeTypecreateEdge(VertexType source, VertexType target)
Iterator<EdgeType>edgeIterator()
intgetNumEdgeLabels()
intgetNumEdges()
intgetNumIncomingEdges(VertexType vertex)
intgetNumOutgoingEdges(VertexType vertex)
intgetNumVertexLabels()
intgetNumVertices()
Iterator<EdgeType>incomingEdgeIterator(VertexType target)
EdgeTypelookupEdge(VertexType source, VertexType target)
Iterator<EdgeType>outgoingEdgeIterator(VertexType source)
Iterator<VertexType>predecessorIterator(VertexType target)
voidremoveEdge(EdgeType edge)
voidremoveVertex(VertexType v)
voidsetNumEdgeLabels(int numLabels)
voidsetNumVertexLabels(int numLabels)
Iterator<VertexType>successorIterator(VertexType source)
Iterator<VertexType>vertexIterator()

Constructor Detail

AbstractGraph

public AbstractGraph()

Method Detail

addVertex

public void addVertex(VertexType v)

allocateEdge

protected abstract EdgeType allocateEdge(VertexType source, VertexType target)

containsVertex

public boolean containsVertex(VertexType v)

createEdge

public EdgeType createEdge(VertexType source, VertexType target)

edgeIterator

public Iterator<EdgeType> edgeIterator()

getNumEdgeLabels

public int getNumEdgeLabels()

getNumEdges

public int getNumEdges()

getNumIncomingEdges

public int getNumIncomingEdges(VertexType vertex)

getNumOutgoingEdges

public int getNumOutgoingEdges(VertexType vertex)

getNumVertexLabels

public int getNumVertexLabels()

getNumVertices

public int getNumVertices()

incomingEdgeIterator

public Iterator<EdgeType> incomingEdgeIterator(VertexType target)

lookupEdge

public EdgeType lookupEdge(VertexType source, VertexType target)

outgoingEdgeIterator

public Iterator<EdgeType> outgoingEdgeIterator(VertexType source)

predecessorIterator

public Iterator<VertexType> predecessorIterator(VertexType target)

removeEdge

public void removeEdge(EdgeType edge)

removeVertex

public void removeVertex(VertexType v)

setNumEdgeLabels

public void setNumEdgeLabels(int numLabels)

setNumVertexLabels

public void setNumVertexLabels(int numLabels)

successorIterator

public Iterator<VertexType> successorIterator(VertexType source)

vertexIterator

public Iterator<VertexType> vertexIterator()
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.