org.grinvin.graphs

Class DefaultVertex

Implemented Interfaces:
Element, Vertex

public class DefaultVertex
extends java.lang.Object
implements Vertex

Default implementation of Vertex.

Method Summary

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

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.

Specified by:
getIndex in interface Vertex

setIndex

public void setIndex(int index)
Specified by:
setIndex in interface Vertex