|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsalvo.jesus.graph.DirectedGraphWeakImpl
class DirectedGraphWeakImpl
A weak implementation of the DirectedGraph interface.
Field Summary | |
---|---|
(package private) GraphImpl |
graph
The GraphImpl object which has delegated the DirectedGraph interface implementation to this object - DirectedGraphWeakImpl. |
(package private) java.util.Map |
incomingEdges
Vector of incoming edges in the graph. |
(package private) java.util.Map |
outgoingEdges
Vector of outgoing edges in the graph. |
Constructor Summary | |
---|---|
DirectedGraphWeakImpl(GraphImpl graph)
Creates a new instance of DirectedGraphWeakImpl. |
|
DirectedGraphWeakImpl(GraphImpl graph,
DirectedGraphWeakImpl toBeCopied)
Copy constructor |
Method Summary | |
---|---|
void |
add(Vertex newvertex)
Adds a new Vector in both the incoming and outgoing Vector of Edges. |
protected void |
addEdge(DirectedEdge dedge)
Adds the Edge created as an outgoing edge of one vertex and as an incoming edge of the other vertex. |
void |
addEdge(Edge edge)
Empty method implemetation that does nothing. |
Edge |
addEdge(Vertex v1,
Vertex v2)
Empty method implemetation that returns null. |
void |
addGraphAddEdgeListener(GraphAddEdgeListener listener)
Empty method implemetation that returns null. |
void |
addGraphAddVertexListener(GraphAddVertexListener listener)
Empty method implemetation that returns null. |
void |
addGraphRemoveEdgeListener(GraphRemoveEdgeListener listener)
Empty method implemetation that returns null. |
void |
addGraphRemoveVertexListener(GraphRemoveVertexListener listener)
Empty method implemetation that returns null. |
java.util.Collection |
cloneVertices()
Empty method implemetation that returns null. |
Edge |
createEdge(Vertex v1,
Vertex v2)
Empty method implemetation that returns null. |
java.util.Collection |
getAdjacentVertices(java.util.Collection vertices)
Empty method implemetation that returns null. |
java.util.Collection |
getAdjacentVertices(Vertex v)
Empty method implemetation that returns null. |
private java.util.Collection |
getAdjacentVertices(Vertex v,
boolean outGoing)
Returns the vertices that are adjacent to a specified Vertex, respecting the direction of the Edge from the specified Vertex. |
java.util.Collection |
getConnectedSet()
Empty method implemetation that returns null. |
java.util.Collection |
getConnectedSet(Vertex v)
Empty method implemetation that returns null. |
int |
getDegree()
Empty method implemetation that returns 0. |
int |
getDegree(Vertex v)
Empty method implemetation that returns 0. |
DirectedEdge |
getEdge(Vertex fromvertex,
Vertex tovertex)
Returns an Edge in the Graph whose origin is fromVertex and destination is toVertex. |
java.util.Collection |
getEdges(Vertex v)
Empty method implemetation that returns null. |
java.util.Collection |
getIncomingAdjacentVertices(Vertex v)
Returns the vertices that are adjacent to a specified Vertex where the Edge is incoming from the specified Vertex to the adjacent vertex. |
protected java.util.Map |
getIncomingEdges()
Returns the incoming EdgeSets of the Graph. |
java.util.Collection |
getIncomingEdges(Vertex v)
Returns the incoming edges of a particular Vertex in the Graph. |
java.util.Collection |
getOutgoingAdjacentVertices(Vertex v)
Returns the vertices that are adjacent to a specified Vertex where the Edge is outgoing from the specified Vertex to the adjacent vertex. |
protected java.util.Map |
getOutgoingEdges()
Returns the outgoing EdgeSets of the Graph. |
java.util.Collection |
getOutgoingEdges(Vertex v)
Returns the outgoing edges of a particular Vertex in the Graph. |
GraphTraversal |
getTraversal()
Empty method implemetation that returns null. |
java.util.Set |
getVertices(int degree)
Empty method implemetation that returns null. |
int |
getVerticesCount()
Empty method implemetation that returns 0. |
java.util.Iterator |
getVerticesIterator()
Empty method implemetation that returns null. |
boolean |
isConnected(Vertex v1,
Vertex v2)
Empty method implemetation that returns false. |
boolean |
isCycle(Vertex fromVertex)
Determines if there is a cycle from Vertex fromVertex. |
boolean |
isPath(Vertex fromVertex,
Vertex toVertex)
Determines if there is a path from Vertex fromVertex to Vertex toVertex. |
void |
mergeconnectedSet(Vertex v1,
Vertex v2)
Empty method implemetation that returns null. |
void |
remove(Vertex someVertex)
Removes the vertex's vectors of incoming and outgoing edges.. |
protected void |
removeEdge(DirectedEdge dedge)
Removes the Edge as the incoming and outgoing edge of the vertices at the ends of the Edge. |
void |
removeEdge(Edge e)
Empty method implemetation that returns null. |
void |
removeEdges(Vertex v)
Empty method implemetation that returns null. |
void |
removeGraphAddEdgeListener(GraphAddEdgeListener listener)
Empty method implemetation that returns null. |
void |
removeGraphAddVertexListener(GraphAddVertexListener listener)
Empty method implemetation that returns null. |
void |
removeGraphRemoveEdgeListener(GraphRemoveEdgeListener listener)
Empty method implemetation that returns null. |
void |
removeGraphRemoveVertexListener(GraphRemoveVertexListener listener)
Empty method implemetation that returns null. |
void |
setTraversal(GraphTraversal traversal)
Empty method implemetation that returns null. |
java.util.Vector |
traverse(Vertex startat)
Empty method implemetation that returns null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
GraphImpl graph
java.util.Map outgoingEdges
java.util.Map incomingEdges
Constructor Detail |
---|
public DirectedGraphWeakImpl(GraphImpl graph)
public DirectedGraphWeakImpl(GraphImpl graph, DirectedGraphWeakImpl toBeCopied)
Method Detail |
---|
protected java.util.Map getOutgoingEdges()
protected java.util.Map getIncomingEdges()
public java.util.Collection getOutgoingEdges(Vertex v)
getOutgoingEdges
in interface DirectedGraph
v
- Vertex you want to determine its outgoing edges.
public java.util.Collection getIncomingEdges(Vertex v)
getIncomingEdges
in interface DirectedGraph
v
- Vertex you want to determine its incoming edges.
private java.util.Collection getAdjacentVertices(Vertex v, boolean outGoing)
v
- Vertex you want to determine its outgoing adjacent vertices.outGoing
- If true, method will return outgoing adjacent vertices.
If false, method will return incoming adjacent vertices.
public java.util.Collection getOutgoingAdjacentVertices(Vertex v)
getOutgoingAdjacentVertices
in interface DirectedGraph
v
- Vertex you want to determine its outgoing adjacent vertices.
public java.util.Collection getIncomingAdjacentVertices(Vertex v)
getIncomingAdjacentVertices
in interface DirectedGraph
v
- Vertex you want to determine its incoming adjacent vertices.
public DirectedEdge getEdge(Vertex fromvertex, Vertex tovertex)
getEdge
in interface DirectedGraph
fromVertex
- Vertex that is the origin of the directed EdgetoVertex
- Vertex that is the destination of the directed Edge
Edge
public boolean isPath(Vertex fromVertex, Vertex toVertex)
isPath
in interface DirectedGraph
fromVertex
- starting Vertex for the pathtoVertex
- ending Vertex for the path
public boolean isCycle(Vertex fromVertex)
isCycle
in interface DirectedGraph
fromVertex
- Vertex to be tested for a cycle path.
public void add(Vertex newvertex)
add
in interface Graph
newvertex
- The Vertex object to be added to the graph.public void remove(Vertex someVertex)
remove
in interface Graph
someVertex
- vertex to be removedprotected void addEdge(DirectedEdge dedge)
fromVertex
- Vertex that will be the source of the EdgetoVertex
- Vertex that will be the sink of the Edgeprotected void removeEdge(DirectedEdge dedge)
edge
- Edge to be removed from the Graphpublic int getVerticesCount()
getVerticesCount
in interface Graph
public java.util.Iterator getVerticesIterator()
getVerticesIterator
in interface Graph
public java.util.Collection cloneVertices()
cloneVertices
in interface Graph
public Edge createEdge(Vertex v1, Vertex v2)
createEdge
in interface Graph
v1
- One endpoint of the edgev2
- Other endpoint of the edgepublic Edge addEdge(Vertex v1, Vertex v2)
addEdge
in interface Graph
v1
- One endpoint of the edgev2
- Other endpoint of the edge
public void addEdge(Edge edge)
addEdge
in interface Graph
edge
- The edge to be added to the Graph.public void removeEdge(Edge e)
removeEdge
in interface Graph
e
- The Edge object to be removed.public void removeEdges(Vertex v)
removeEdges
in interface Graph
v
- Vertex whose Edges are to be removedpublic int getDegree()
getDegree
in interface Graph
public int getDegree(Vertex v)
getDegree
in interface Graph
public java.util.Set getVertices(int degree)
getVertices
in interface Graph
degree
- The degree of the vertex to be returned.
public java.util.Collection getEdges(Vertex v)
getEdges
in interface Graph
v
- The vertex whose edges we want returned
public java.util.Collection getAdjacentVertices(Vertex v)
getAdjacentVertices
in interface Graph
v
- The Vertex you want to determine its adjacent vertices.
public java.util.Collection getAdjacentVertices(java.util.Collection vertices)
getAdjacentVertices
in interface Graph
vertices
- Vector of Vertex where each vertex in the returned Set
must be adjacent to.
public java.util.Collection getConnectedSet()
getConnectedSet
in interface Graph
public java.util.Collection getConnectedSet(Vertex v)
getConnectedSet
in interface Graph
v
- Vertex to which you want the connected set returned.
public void mergeconnectedSet(Vertex v1, Vertex v2)
mergeconnectedSet
in interface Graph
v1
- Vertex whose connected set you want merged
with the connected set of Vertex v2.v2
- Vertex whose connected set you want merged
with the connected set of Vertex v1.public java.util.Vector traverse(Vertex startat)
traverse
in interface Graph
startat
- The Vertex to which you want to start the traversal.public GraphTraversal getTraversal()
getTraversal
in interface Graph
public void setTraversal(GraphTraversal traversal)
setTraversal
in interface Graph
traversal
- A concrete implementation of the GraphTraversal object.public boolean isConnected(Vertex v1, Vertex v2)
isConnected
in interface Graph
v1
- starting Vertex for the pathv2
- ending Vertex for the path
public void addGraphAddVertexListener(GraphAddVertexListener listener)
addGraphAddVertexListener
in interface Graph
listener
- GraphAddVertexListener you want registered
or be notified when a new Vertex is addedGraphAddVertexListener
,
Graph.removeGraphAddVertexListener( GraphAddVertexListener )
public void addGraphAddEdgeListener(GraphAddEdgeListener listener)
addGraphAddEdgeListener
in interface Graph
listener
- GraphAddEdgeListener you want registered
or be notified when a new Edge is addedGraphAddEdgeListener
,
Graph.removeGraphAddEdgeListener( GraphAddEdgeListener )
public void addGraphRemoveEdgeListener(GraphRemoveEdgeListener listener)
addGraphRemoveEdgeListener
in interface Graph
listener
- GraphRemoveEdgeListener you want registered
or be notified when an Edge is removedGraphRemoveEdgeListener
,
Graph.removeGraphRemoveEdgeListener( GraphRemoveEdgeListener )
public void addGraphRemoveVertexListener(GraphRemoveVertexListener listener)
addGraphRemoveVertexListener
in interface Graph
listener
- GraphRemoveVertexListener you want registered
or be notified when a Vertex is removedGraphRemoveVertexListener
,
Graph.removeGraphRemoveVertexListener( GraphRemoveVertexListener )
public void removeGraphAddVertexListener(GraphAddVertexListener listener)
removeGraphAddVertexListener
in interface Graph
listener
- GraphAddVertexListener you no longer want registered
or be notified when a Vertex is addedGraphAddVertexListener
,
Graph.addGraphAddVertexListener( GraphAddVertexListener )
public void removeGraphAddEdgeListener(GraphAddEdgeListener listener)
removeGraphAddEdgeListener
in interface Graph
listener
- GraphAddEdgeListener you no longer want registered
or be notified when an Edge is addedGraphAddEdgeListener
,
Graph.addGraphAddEdgeListener( GraphAddEdgeListener )
public void removeGraphRemoveEdgeListener(GraphRemoveEdgeListener listener)
removeGraphRemoveEdgeListener
in interface Graph
listener
- GraphRemoveEdgeListener you no longer want registered
or be notified when an Edge is removedGraphRemoveEdgeListener
,
Graph.addGraphRemoveEdgeListener( GraphRemoveEdgeListener )
public void removeGraphRemoveVertexListener(GraphRemoveVertexListener listener)
removeGraphRemoveVertexListener
in interface Graph
listener
- GraphRemoveVertexListener you no longer want registered
or be notified when a Vertex is removedGraphRemoveVertexListener
,
Graph.addGraphRemoveVertexListener( GraphRemoveVertexListener )
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |