helix.graph.model.impl.memory
Class MemVertex

java.lang.Object
  extended by helix.graph.model.impl.AbstractRegistry
      extended by helix.graph.model.impl.memory.MemRegistry
          extended by helix.graph.model.impl.memory.MemVertex
All Implemented Interfaces:
GraphElement, Registry, Vertex

public class MemVertex
extends MemRegistry
implements Vertex


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);
}
 String toString()
          a human readable version of toString()
 
Methods inherited from class helix.graph.model.impl.memory.MemRegistry
get, has, keys, remove, set
 
Methods inherited from class helix.graph.model.impl.AbstractRegistry
copy, registry, set, set, set, set, set
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface helix.graph.model.Registry
copy, get, has, keys, registry, remove, set, set, set, set, set, set
 

Method Detail

degree

public int degree()
Description copied from interface: Vertex
get the number edges that are incident edges to this vertex

Specified by:
degree in interface Vertex
Returns:
vertex degree

getEdgeTo

public Edge getEdgeTo(Vertex v)
Description copied from interface: Vertex
get the edge between this vertex and destination vertex v (if it exists)

Specified by:
getEdgeTo in interface Vertex
Parameters:
v - destination vertex
Returns:
edge (this, v) if it exists else return null

hasEdgeTo

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

Specified by:
hasEdgeTo in interface Vertex
Parameters:
v - destination vertex
Returns:
true if edge (this, v) exists

edges

public Iterable<Edge> edges()
Description copied from interface: Vertex
get Iterable over all edges that are incident to this vertex

Specified by:
edges in interface Vertex
Returns:
Iterable

neighbors

public Iterable<Vertex> neighbors()
Description copied from interface: Vertex
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);
}

Specified by:
neighbors in interface Vertex
Returns:
Iterable

toString

public String toString()
a human readable version of toString()

Overrides:
toString in class Object