|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvisidia.misc.property.PropertyTable
visidia.graph.Vertex
public class Vertex
The Class Vertex represents a graph vertex by a unique identifier. A vertex knows both its neighbors and its incident edges. There is at most one edge between two vertices. A vertex can have a set of properties, stored in a whiteboard (property table).
Field Summary | |
---|---|
protected java.util.Vector<Edge> |
edges
The incident edges. |
protected java.util.Vector<Vertex> |
neighbors
The neighbors. |
Constructor Summary | |
---|---|
protected |
Vertex(int id)
Instantiates a new vertex. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a clone of this vertex (shallow copy). |
int |
degree()
Computes the vertex degree as the number of its neighbors. |
int |
getDoorTo(Vertex v)
Gets the door through which this vertex goes to v. |
Edge |
getEdge(Vertex v)
Gets the edge incident to vertex v and this. |
java.util.Enumeration<Edge> |
getEdges()
Gets the incident edges. |
int |
getId()
Gets the vertex id. |
java.lang.String |
getLabel()
Gets the label. |
Vertex |
getNeighborByDoor(int door)
Gets the neighbor associated to the door. |
java.util.Enumeration<Vertex> |
getNeighbors()
Gets the neighbors. |
boolean |
isSwitchedOn()
Checks if is switched on. |
Edge |
linkTo(Vertex v,
boolean oriented)
Links to another vertex (create an edge). |
void |
merge(Vertex v)
Merges vertex v to this. |
void |
removeIncidentEdges()
Removes the incident edges. |
void |
resetProperties()
Reset properties. |
void |
setId(int id)
Sets the vertex id. |
void |
setLabel(java.lang.String label)
Sets the label. |
java.lang.Object |
setProperty(VisidiaProperty property)
Sets a property. |
void |
setSwitchedOn(boolean switchedOn)
Switches the vertex on/off. |
void |
unlink(Vertex v)
Unlinks this vertex and vertex v. |
Methods inherited from class visidia.misc.property.PropertyTable |
---|
containsElement, entrySet, getLockOwner, getPropertyKeys, getVisidiaProperty, isPersistentProperty, locked, lockProperties, removeProperty, setProperties, setVisidiaProperty, unlockProperties |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector<Vertex> neighbors
protected java.util.Vector<Edge> edges
Constructor Detail |
---|
protected Vertex(int id)
id
- the vertex idMethod Detail |
---|
public Edge linkTo(Vertex v, boolean oriented)
v
- the vertex to be linked to.oriented
- the oriented
public Edge getEdge(Vertex v)
v
- the vertex
public void unlink(Vertex v)
v
- a vertex.public java.util.Enumeration<Vertex> getNeighbors()
public Vertex getNeighborByDoor(int door)
door
- the door
public int getDoorTo(Vertex v)
v
- the v
public java.util.Enumeration<Edge> getEdges()
public int getId()
public void setId(int id)
id
- the new idpublic int degree()
public void removeIncidentEdges()
public void merge(Vertex v)
v
- the vertexpublic java.lang.Object clone()
clone
in class PropertyTable
Object.clone()
public void resetProperties()
resetProperties
in class PropertyTable
public java.lang.Object setProperty(VisidiaProperty property)
property
- the property
null
if it did not have one.public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- the new labelpublic boolean isSwitchedOn()
public void setSwitchedOn(boolean switchedOn)
switchedOn
- the switched on
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |