scratch.joshua.jung_2_0.core
Class SimpleAbstractSparseGraph<V,E>

java.lang.Object
  extended by scratch.joshua.jung_2_0.core.SimpleAbstractSparseGraph<V,E>
All Implemented Interfaces:
ArchetypeGraph<V,E>, Graph<V,E>
Direct Known Subclasses:
SimpleDirectedSparseGraph, SimpleUndirectedSparseGraph

public abstract class SimpleAbstractSparseGraph<V,E>
extends Object
implements Graph<V,E>


Constructor Summary
SimpleAbstractSparseGraph()
           
 
Method Summary
 boolean areIncident(V vertex, E edge)
           
 boolean areNeighbors(V v1, V v2)
           
 int degree(V vertex)
           
 Collection<V> getIncidentVertices(E edge)
           
 V getOpposite(V vertex, E edge)
           
 int inDegree(V vertex)
           
 boolean isPredecessor(V v1, V v2)
           
 boolean isSuccessor(V v1, V v2)
           
 int numNeighbors(V vertex)
           
 int numPredecessors(V vertex)
           
 int numSuccessors(V vertex)
           
 int outDegree(V vertex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface scratch.joshua.jung_2_0.core.Graph
getEndpoints, getInEdges, getOutEdges, getPredecessors, getSuccessors
 
Methods inherited from interface scratch.joshua.jung_2_0.core.ArchetypeGraph
addVertex, findEdge, getEdges, getIncidentEdges, getNeighbors, getVertices, removeEdge, removeVertex
 

Constructor Detail

SimpleAbstractSparseGraph

public SimpleAbstractSparseGraph()
Method Detail

inDegree

public int inDegree(V vertex)
Specified by:
inDegree in interface Graph<V,E>

outDegree

public int outDegree(V vertex)
Specified by:
outDegree in interface Graph<V,E>

isPredecessor

public boolean isPredecessor(V v1,
                             V v2)
Specified by:
isPredecessor in interface Graph<V,E>

isSuccessor

public boolean isSuccessor(V v1,
                           V v2)
Specified by:
isSuccessor in interface Graph<V,E>

numPredecessors

public int numPredecessors(V vertex)
Specified by:
numPredecessors in interface Graph<V,E>

numSuccessors

public int numSuccessors(V vertex)
Specified by:
numSuccessors in interface Graph<V,E>

areNeighbors

public boolean areNeighbors(V v1,
                            V v2)
Specified by:
areNeighbors in interface ArchetypeGraph<V,E>

areIncident

public boolean areIncident(V vertex,
                           E edge)
Specified by:
areIncident in interface ArchetypeGraph<V,E>

numNeighbors

public int numNeighbors(V vertex)
Specified by:
numNeighbors in interface ArchetypeGraph<V,E>

degree

public int degree(V vertex)
Specified by:
degree in interface ArchetypeGraph<V,E>

getOpposite

public V getOpposite(V vertex,
                     E edge)
Specified by:
getOpposite in interface Graph<V,E>

getIncidentVertices

public Collection<V> getIncidentVertices(E edge)
Specified by:
getIncidentVertices in interface ArchetypeGraph<V,E>