|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclassycle.graph.Vertex
public class Vertex
The base class for any type of vertex in a directed graph.
A Vertex holds an Attributes
object which encapsulates
all properties of the vertex which are not necessary to know for
parsing a graph in a GraphProcessor
. Only the visited flag will
be manipulated during parsing.
A Vertex knows the head and tail vertices of all its outgoing
and incoming arcs. When a head vertex is added by the method
addOutgoingArcTo(classycle.graph.Vertex)
also the corresponding incoming arc is built
in the head vertex. The same is true the other way around. Note,
that multi-arcs are not possible. That is, adding an already added
head/tail vertex again as a head/tail vertex will be ignored.
Constructor Summary | |
---|---|
Vertex(Attributes attributes)
Create a new instance for the specified attributes. |
Method Summary | |
---|---|
void |
addIncomingArcTo(Vertex tailVertex)
Adds an incoming arc to the specified vertex. |
void |
addOutgoingArcTo(Vertex headVertex)
Adds an outgoing arc to the specified vertex. |
int |
compareTo(java.lang.Object object)
|
Attributes |
getAttributes()
Returns the attributes. |
Vertex |
getHeadVertex(int index)
Returns the head vertex of the specified outgoing arc. |
int |
getNumberOfIncomingArcs()
Returns the number of incoming arcs. |
int |
getNumberOfOutgoingArcs()
Returns the number of outgoing arcs. |
Vertex |
getTailVertex(int index)
Returns the tail vertex of the specified outgoing arc. |
boolean |
isVisited()
Returns the visited flag. |
void |
reset()
Reset this vertex. |
java.lang.String |
toString()
Returns toString() of the attributes and the number of incoming and outgoing arcs. |
void |
visit()
Marks this instance as visited. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Vertex(Attributes attributes)
Method Detail |
---|
public Attributes getAttributes()
public int getNumberOfOutgoingArcs()
public Vertex getHeadVertex(int index)
public void addOutgoingArcTo(Vertex headVertex)
addIncomingArcTo(classycle.graph.Vertex)
for headVertex with this as
the argument. Does nothing if headVertex is the head
vertex of an already existing outgoing arc.
headVertex
- Head vertex to be added to establish a new outgoing arc.
Null is not allowed.public int getNumberOfIncomingArcs()
public Vertex getTailVertex(int index)
public void addIncomingArcTo(Vertex tailVertex)
addOutgoingArcTo(classycle.graph.Vertex)
for tailVertex with this as
the argument. Does nothing if tailVertex is the
tail vertex of an already existing incoming arc.
tailVertex
- Tail vertex to be added to establish a new incoming arc.
Null is not allowed.public void reset()
public void visit()
public boolean isVisited()
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |