scratch.joshua.jung_2_0.core
Class SimpleUndirectedSparseGraph<V,E>
java.lang.Object
scratch.joshua.jung_2_0.core.SimpleAbstractSparseGraph<V,E>
scratch.joshua.jung_2_0.core.SimpleUndirectedSparseGraph<V,E>
- All Implemented Interfaces:
- ArchetypeGraph<V,E>, Graph<V,E>, UndirectedGraph<V,E>
public class SimpleUndirectedSparseGraph<V,E>
- extends SimpleAbstractSparseGraph<V,E>
- implements UndirectedGraph<V,E>
Methods inherited from class scratch.joshua.jung_2_0.core.SimpleAbstractSparseGraph |
areIncident, areNeighbors, degree, getIncidentVertices, getOpposite, inDegree, isPredecessor, isSuccessor, numNeighbors, numPredecessors, numSuccessors, outDegree |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
vertices
protected Map<V,Set<E>> vertices
edges
protected Map<E,Pair<V>> edges
SimpleUndirectedSparseGraph
public SimpleUndirectedSparseGraph()
getEdges
public Collection<E> getEdges()
- Specified by:
getEdges
in interface ArchetypeGraph<V,E>
getVertices
public Collection<V> getVertices()
- Specified by:
getVertices
in interface ArchetypeGraph<V,E>
addVertex
public boolean addVertex(V vertex)
- Specified by:
addVertex
in interface ArchetypeGraph<V,E>
removeVertex
public boolean removeVertex(V vertex)
- Specified by:
removeVertex
in interface ArchetypeGraph<V,E>
addUndirectedEdge
public boolean addUndirectedEdge(E edge,
V v1,
V v2)
- Specified by:
addUndirectedEdge
in interface UndirectedGraph<V,E>
removeEdge
public boolean removeEdge(E edge)
- Specified by:
removeEdge
in interface ArchetypeGraph<V,E>
getInEdges
public Collection<E> getInEdges(V vertex)
- Specified by:
getInEdges
in interface Graph<V,E>
getOutEdges
public Collection<E> getOutEdges(V vertex)
- Specified by:
getOutEdges
in interface Graph<V,E>
getPredecessors
public Collection<V> getPredecessors(V vertex)
- Specified by:
getPredecessors
in interface Graph<V,E>
getSuccessors
public Collection<V> getSuccessors(V vertex)
- Specified by:
getSuccessors
in interface Graph<V,E>
getNeighbors
public Collection<V> getNeighbors(V vertex)
- Specified by:
getNeighbors
in interface ArchetypeGraph<V,E>
getIncidentEdges
public Collection<E> getIncidentEdges(V vertex)
- Specified by:
getIncidentEdges
in interface ArchetypeGraph<V,E>
findEdge
public E findEdge(V v1,
V v2)
- Specified by:
findEdge
in interface ArchetypeGraph<V,E>
getEndpoints
public Pair<V> getEndpoints(E edge)
- Specified by:
getEndpoints
in interface Graph<V,E>