pedviz.algorithms
Class Highlighter

java.lang.Object
  extended by pedviz.algorithms.Highlighter

public class Highlighter
extends java.lang.Object

This class provides some generally useful methods for finding parents and children by a given node and checking if exists a path between two nodes.

Version:
0.1
Author:
Lukas Forer

Field Summary
static int ANCESTORS
          All ancestors of a person.
static int MATERNAL
          Maternal lineage of a person.
static int MATERNAL_AND_PATERNAL
          Maternal and paternal lineage of a person.
static int PATERNAL
          Paternal lineage of a person.
static int SUCCESSORS
          All successors of a person.
static int SUCCESSORS_AND_ANCESTORS
          All successors and ancestors of a person.
 
Constructor Summary
Highlighter()
           
 
Method Summary
static java.util.ArrayList<Node> findLineOfDescents(Graph graph, Node node, int mode)
           Returns a collection of nodes dependent on the given mode.
static java.util.ArrayList<Node> findParentsAndChilds(Node node)
          Returns all ancestors and successor for the given node.
static java.util.ArrayList<Node> findParentsAndChilds(Node node, int max)
          Returns the ancestors and successors for the given node.
static java.util.ArrayList<Node> findPath(Node nodeA, Node nodeB)
          Checks if exists a path between nodeA and nodeB.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MATERNAL

public static final int MATERNAL
Maternal lineage of a person.

See Also:
Constant Field Values

PATERNAL

public static final int PATERNAL
Paternal lineage of a person.

See Also:
Constant Field Values

MATERNAL_AND_PATERNAL

public static final int MATERNAL_AND_PATERNAL
Maternal and paternal lineage of a person.

See Also:
Constant Field Values

SUCCESSORS

public static final int SUCCESSORS
All successors of a person.

See Also:
Constant Field Values

ANCESTORS

public static final int ANCESTORS
All ancestors of a person. (default)

See Also:
Constant Field Values

SUCCESSORS_AND_ANCESTORS

public static final int SUCCESSORS_AND_ANCESTORS
All successors and ancestors of a person.

See Also:
Constant Field Values
Constructor Detail

Highlighter

public Highlighter()
Method Detail

findPath

public static java.util.ArrayList<Node> findPath(Node nodeA,
                                                 Node nodeB)
Checks if exists a path between nodeA and nodeB.

Parameters:
nodeA - start node
nodeB - destination node
Returns:
all nodes on this path.

findParentsAndChilds

public static java.util.ArrayList<Node> findParentsAndChilds(Node node,
                                                             int max)
Returns the ancestors and successors for the given node. You can define the number of max generations, that should be considered.

Parameters:
node - The node
max - Number of max generations that should be considered.
Returns:
list of ancestors and successors

findParentsAndChilds

public static java.util.ArrayList<Node> findParentsAndChilds(Node node)
Returns all ancestors and successor for the given node.

Parameters:
node - The node
Returns:
list of ancestors and successors

findLineOfDescents

public static java.util.ArrayList<Node> findLineOfDescents(Graph graph,
                                                           Node node,
                                                           int mode)

Returns a collection of nodes dependent on the given mode.

Parameters:
graph - Graph object
node - strat node
mode - mode
Returns:
a collection of nodes dependent on the given mode.