|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.graph.model.InMemoryPath<V,WE>
V - the Graph vertices typeWE - the Graph weighted edges typepublic final class InMemoryPath<V extends Vertex,WE extends WeightedEdge<V>>
Support WeightedPath implementation, optimized for algorithms (such Dijkstra's) that need to rebuild the path
traversing the predecessor list bottom-up.
| Constructor Summary | |
|---|---|
InMemoryPath(V start,
V end,
Double weigth)
|
|
| Method Summary | |
|---|---|
void |
addEdgeInHead(WE edge)
|
void |
addEdgeInTail(WE edge)
|
void |
addVertexInHead(V vertex)
|
void |
addVertexInTail(V vertex)
|
boolean |
equals(Object obj)
|
List<WE> |
getEdges()
getEdges() - This returns a list of Edges which comprise the path. |
V |
getSource()
Returns the source of the path. |
V |
getTarget()
Returns the target of the path. |
List<V> |
getVertices()
getVertices() - This returns a list of Vertices, in order as they go from Start to End. |
Double |
getWeight()
Gets the weight attribute of the WeightedPath object. |
int |
hashCode()
|
int |
size()
size() - This returns the size of the path in terms of number of verticies it visits. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public InMemoryPath(V start,
V end,
Double weigth)
| Method Detail |
|---|
public V getSource()
getSource in interface Path<V extends Vertex,WE extends WeightedEdge<V>>public V getTarget()
getTarget in interface Path<V extends Vertex,WE extends WeightedEdge<V>>public void addVertexInHead(V vertex)
public void addVertexInTail(V vertex)
public List<V> getVertices()
getVertices in interface Path<V extends Vertex,WE extends WeightedEdge<V>>public void addEdgeInHead(WE edge)
public void addEdgeInTail(WE edge)
public List<WE> getEdges()
getEdges in interface Path<V extends Vertex,WE extends WeightedEdge<V>>public int size()
size in interface Path<V extends Vertex,WE extends WeightedEdge<V>>public Double getWeight()
WeightedPath object.
getWeight in interface WeightedPath<V extends Vertex,WE extends WeightedEdge<V>>WeightedPath object.public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||