public class DirectedSimpleVertex extends AbstractVertex
Constructor and Description |
---|
DirectedSimpleVertex()
Default constructor initializes graph to null and creates an empty adjacency list
|
Modifier and Type | Method and Description |
---|---|
<T extends Vertex> |
addAdjacency(T to)
Adds the specified vertex to the set of adjacencies.
|
int |
adjacencyCount()
Returns the number of vertices in the adjacency set
|
void |
clearAdjacencies()
Removes all vertices from the adjacency set.
|
boolean |
containsAdjacency(Vertex to)
Returns true if the adjacency set contains the specified vertex
|
java.util.Set<? extends Vertex> |
getAdjacencies()
Returns a set of all adjacent vertices
|
boolean |
hasAdjacencies()
Returns true if the vertex is the tail of at least one edge
|
boolean |
removeAdjacency(Vertex to)
Removes the specified vertex from the adjacency set.
|
equals, getGraph, setGraph
public DirectedSimpleVertex()
public <T extends Vertex> boolean addAdjacency(T to)
Vertex
to
- vertex to be addedpublic boolean removeAdjacency(Vertex to)
Vertex
to
- vertex to be removedpublic void clearAdjacencies()
Vertex
public boolean containsAdjacency(Vertex to)
Vertex
to
- vertex whose presence is to be testedpublic final int adjacencyCount()
Vertex
public final java.util.Set<? extends Vertex> getAdjacencies()
Vertex
public final boolean hasAdjacencies()
Vertex