|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.util.graph.Vertex<T>
T - public class Vertex<T>
A named graph vertex with optional data.
| Constructor Summary | |
|---|---|
Vertex()
Calls this(null, null). |
|
Vertex(String n)
Create a vertex with the given name and no data |
|
Vertex(String n,
T data)
Create a Vertex with name n and given data |
|
| Method Summary | |
|---|---|
boolean |
addEdge(Edge<T> e)
Add an edge to the vertex. |
void |
addIncomingEdge(Vertex<T> from,
int cost)
Add an incoming edge starting at from |
void |
addOutgoingEdge(Vertex<T> to,
int cost)
Add an outgoing edge ending at to. |
void |
clearMark()
Clear the visited mark flag. |
int |
cost(Vertex<T> dest)
What is the cost from this vertext to the dest vertex. |
Edge<T> |
findEdge(Edge<T> e)
Search the outgoing edges for a match to e. |
Edge<T> |
findEdge(Vertex<T> dest)
Search the outgoing edges looking for an edge whose's edge.to == dest. |
T |
getData()
|
Edge<T> |
getIncomingEdge(int i)
Get the ith incoming edge |
int |
getIncomingEdgeCount()
|
List |
getIncomingEdges()
Get the incoming edges |
int |
getMarkState()
Get the mark state value. |
String |
getName()
|
Edge<T> |
getOutgoingEdge(int i)
Get the ith outgoing edge |
int |
getOutgoingEdgeCount()
|
List |
getOutgoingEdges()
Get the outgoing edges |
boolean |
hasEdge(Edge<T> e)
Check the vertex for either an incoming or outgoing edge mathcing e. |
boolean |
hasEdge(Vertex<T> dest)
Is there an outgoing edge ending at dest. |
void |
mark()
Set the vertex mark flag. |
boolean |
remove(Edge<T> e)
Remove an edge from this vertex |
void |
setData(T data)
|
void |
setMarkState(int state)
Set the mark state to state. |
String |
toString()
|
void |
visit()
Visit the vertex and set the mark flag to true. |
boolean |
visited()
Has this vertex been marked during a visit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Vertex()
public Vertex(String n)
n -
public Vertex(String n,
T data)
n - - name of vertexdata - - data associated with vertex| Method Detail |
|---|
public String getName()
public T getData()
public void setData(T data)
data - The data to set.public boolean addEdge(Edge<T> e)
e - - the edge to add
public void addOutgoingEdge(Vertex<T> to,
int cost)
to - - the destination vertexcost - the edge cost
public void addIncomingEdge(Vertex<T> from,
int cost)
from - - the starting vertexcost - the edge costpublic boolean hasEdge(Edge<T> e)
e - the edge to check
public boolean remove(Edge<T> e)
e - - the edge to remove
public int getIncomingEdgeCount()
public Edge<T> getIncomingEdge(int i)
i - the index into incoming edges
public List getIncomingEdges()
public int getOutgoingEdgeCount()
public Edge<T> getOutgoingEdge(int i)
i - the index into outgoing edges
public List getOutgoingEdges()
public Edge<T> findEdge(Vertex<T> dest)
dest - the destination
public Edge<T> findEdge(Edge<T> e)
e - - the edge to check
public int cost(Vertex<T> dest)
dest - - the destination vertex.
public boolean hasEdge(Vertex<T> dest)
dest - - the vertex to check
public boolean visited()
public void mark()
public void setMarkState(int state)
state - the statepublic int getMarkState()
public void visit()
public void clearMark()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||