ini.trakem2.analysis
Class Vertex<T>

java.lang.Object
  extended by ini.trakem2.analysis.Vertex<T>

public class Vertex<T>
extends java.lang.Object

A class to express a Vertex in a graph. This class is stateful and not thread-safe.


Field Summary
 float centrality
           
 long d
          Length of the path.
 T data
          The data associated with this node, if any.
 java.util.Set<Vertex<T>> neighbors
           
 long sigma
          Number of short paths passing through this vertex.
 
Constructor Summary
Vertex(T data)
           
 
Method Summary
static
<T> java.util.ArrayList<Vertex<T>>
clone(java.util.Collection<Vertex<T>> vs)
          Clone a collection of vertices, preserving the neighbors.
 java.util.List<Vertex<T>> getBranch(Vertex<T> parent)
          From this vertex to the next branch vertex or end vertex, both inclusive.
 int getNeighborCount()
           
 boolean isBranching()
           
 boolean isEnding()
           
protected  void reset()
          All but neighbors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

centrality

public float centrality

sigma

public long sigma
Number of short paths passing through this vertex.


neighbors

public final java.util.Set<Vertex<T>> neighbors

d

public long d
Length of the path.


data

public T data
The data associated with this node, if any.

Constructor Detail

Vertex

public Vertex(T data)
Method Detail

reset

protected void reset()
All but neighbors.


getNeighborCount

public int getNeighborCount()

clone

public static <T> java.util.ArrayList<Vertex<T>> clone(java.util.Collection<Vertex<T>> vs)
Clone a collection of vertices, preserving the neighbors.

Returns:
An ArrayList of Vertex instances in the same order as @param vs delivered them.

isBranching

public boolean isBranching()

isEnding

public boolean isEnding()

getBranch

public java.util.List<Vertex<T>> getBranch(Vertex<T> parent)
From this vertex to the next branch vertex or end vertex, both inclusive. The @param exclude is the neighbor to ignore.

Throws:
java.lang.IllegalArgumentException - if @param exclude is not a neighbor.