helix.graph.model
Interface Vertex

All Superinterfaces:
GraphElement, Registry
All Known Implementing Classes:
MemVertex

public interface Vertex
extends GraphElement

a graph vertex

Author:
viari

Field Summary
 
Fields inherited from interface helix.graph.model.Registry
Color, Colors, Comment, IsDirect, Label, Orientation, Rank
 
Method Summary
 int degree()
          get the number edges that are incident edges to this vertex
 Iterable<Edge> edges()
          get Iterable over all edges that are incident to this vertex
 Edge getEdgeTo(Vertex v)
          get the edge between this vertex and destination vertex v (if it exists)
 boolean hasEdgeTo(Vertex v)
          tells if there is an edge between this vertex and destination vertex v (if it exists).
 Iterable<Vertex> neighbors()
          get Iterable over all vertices that are adjacent to this vertex
note: the following codes are equivalent :
for (Vertex w : v.neighbors())
  something(w);
and :
for (Edge e : v.edges()) {
  Vertex w = e.getVertexTo(v);
  something(w);
}
 
Methods inherited from interface helix.graph.model.Registry
copy, get, has, keys, registry, remove, set, set, set, set, set, set
 

Method Detail

degree

int degree()
get the number edges that are incident edges to this vertex

Returns:
vertex degree

getEdgeTo

Edge getEdgeTo(Vertex v)
get the edge between this vertex and destination vertex v (if it exists)

Parameters:
v - destination vertex
Returns:
edge (this, v) if it exists else return null

hasEdgeTo

boolean hasEdgeTo(Vertex v)
tells if there is an edge between this vertex and destination vertex v (if it exists). same as getEdgeTo(v) != null

Parameters:
v - destination vertex
Returns:
true if edge (this, v) exists

edges

Iterable<Edge> edges()
get Iterable over all edges that are incident to this vertex

Returns:
Iterable

neighbors

Iterable<Vertex> neighbors()
get Iterable over all vertices that are adjacent to this vertex
note: the following codes are equivalent :
for (Vertex w : v.neighbors())
  something(w);
and :
for (Edge e : v.edges()) {
  Vertex w = e.getVertexTo(v);
  something(w);
}

Returns:
Iterable