org.grinvin

Class Vertex


public class Vertex
extends Element

Represents a single vertex in a graph. A given vertex can belong to at most one graph at the same time.

It is allowed for vertices to 'survive' after having been removed from a graph. Typically, such zombie vertices are kept in memory so that the undo/redo-manager may still restore it to the graph at a later time.

See Also:
DefaultGraphModel

Method Summary

int
getIndex()
Return the current index of this vertex.

Methods inherited from class org.grinvin.Element

getAnnotation

Method Details

getIndex

public int getIndex()
Return the current index of this vertex. This index represents a sequence number in the set of vertices of the graph to which this vertex belongs. The index lies in the range 0..n-1, where n denotes the total number of vertices of the graph.

The index of a vertex may change when other vertices are removed from its parent graph. A vertex which is itself removed from its graph keeps its index.