gov.nasa.javaGenes.graph
Class Trail
java.lang.Object
gov.nasa.javaGenes.graph.Trail
- All Implemented Interfaces:
- java.lang.Cloneable
- public class Trail
- extends java.lang.Object
- implements java.lang.Cloneable
A trail of edges between ends[0] and ends[1]. The edges must be in order, each sharing a common
vertex. The first edge must connect ends[0] and the last edge connect ends[1].
The edges and vertices are never copied or cloned, they are identical to those in the graph.
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
edges
protected ExtendedVector edges
ends
protected Vertex[] ends
Trail
public Trail(Vertex v)
mediumCopyTrail
public Trail mediumCopyTrail()
- keeps original edges and vertices
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- keeps original edges and vertices
- Throws:
java.lang.CloneNotSupportedException
add
public void add(Edge e)
- add a new edge to the trail and update ends[1]
getVertexInEdgeClosestToEnd
public Vertex getVertexInEdgeClosestToEnd(Edge e,
Vertex end)
- Returns:
- the vertex of e closest to end
getStringKey
public java.lang.String getStringKey()
- Returns:
- a string suitable for use as a hashtable key for this trail
getRandomEdge
public Edge getRandomEdge()
getRandomEdge
public Edge getRandomEdge(Predicate p)
- Returns:
- a random edge that satisfies p
getStartVertex
public Vertex getStartVertex()
getEndVertex
public Vertex getEndVertex()