pedviz.graph
Class Node

java.lang.Object
  extended by pedviz.graph.Node

public class Node
extends java.lang.Object

This class represents a individual in a pedigree (Graph).

Version:
0.1
Author:
Lukas Forer

Constructor Summary
Node(java.lang.Object id)
          Creates a new node with the given id.
 
Method Summary
 java.lang.Object clone()
          Clones the Node object.
 java.util.Set<Node> getChilds()
          Returns a collection of all successor.
 java.util.Set<Node> getChilds(int max)
          Returns a collection of all successor.
 int getDegree()
          Returns the number of outgoing and ingoing edges.
 int getFamilieRank()
          Returns the node's familie id.
 Hierarchy getHierarchy()
          Returns the node's hierarchy.
 java.lang.Object getId()
          Returns the id.
 java.lang.Object getIdDad()
          Returns the node's dad id.
 java.lang.Object getIdMom()
          Returns the node's mom id.
 int getInDegree()
          Returns the number of ingoing edges (parents).
 java.util.ArrayList<Edge> getInEdges()
          Returns a collection of ingoing edges (parents).
 int getLevel()
          Returns the node's level in hierarchy.
 int getNodeCount()
          Returns the number of sub nodes.
 java.util.ArrayList<Node> getNodes()
          Returns a collection of all subnodes.
 int getOutDegree()
          Returns the number of outgoing edges (childrens).
 java.util.ArrayList<Edge> getOutEdges()
          Returns a collection of outgoing edges (childrens)
 Node getParent()
          Returns the cluster node, i the node is a subnode.
 java.util.Set<Node> getParents()
          Returns a collection of all ancestors.
 java.util.Set<Node> getParents(int max)
          Returns a collection of all ancestors.
 java.util.Set<Node> getParentsAndChilds()
          Returns a collection of all ancestors and successor.
 java.util.Set<Node> getParentsAndChilds(int max)
          Returns the ancestors and successors for the given node.
 java.util.Set<Node> getPathTo(Node node)
          Returns a collection of all Nodes on the path between this node and the given node.
 java.lang.Object getUserData(java.lang.String title)
          Returns the trait that can be identified by the given title.
 java.lang.Object[] getUserDataList()
          Returns a array of all traits.
 boolean hasParents()
          Returns true, if the node has parents.
 boolean isDummy()
          Returns true, if the node is a dummy.
 void setDummy(boolean dummy)
          Sets
 void setFamilieRank(int familieRank)
          Sets the node's familie id.
 void setIdDad(java.lang.Object idDad)
          Sets the node's dad id.
 void setIdMom(java.lang.Object idMom)
          Sets the node's mom id.
 void setUserData(java.lang.String title, java.lang.Object data)
          Stores an trait that can be identified by the given identifier.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node(java.lang.Object id)
Creates a new node with the given id.

Parameters:
id - id
Method Detail

clone

public java.lang.Object clone()
Clones the Node object.

Overrides:
clone in class java.lang.Object

getInDegree

public int getInDegree()
Returns the number of ingoing edges (parents).

Returns:
number of ingoing edges.

getOutDegree

public int getOutDegree()
Returns the number of outgoing edges (childrens).

Returns:
number of outngoing edges.

getId

public java.lang.Object getId()
Returns the id.

Returns:
the id.

getInEdges

public java.util.ArrayList<Edge> getInEdges()
Returns a collection of ingoing edges (parents).

Returns:
list of ingoining edges

getOutEdges

public java.util.ArrayList<Edge> getOutEdges()
Returns a collection of outgoing edges (childrens)

Returns:
collection of outgoing edges

isDummy

public boolean isDummy()
Returns true, if the node is a dummy.

Returns:

setDummy

public void setDummy(boolean dummy)
Sets

Parameters:
dummy -

getNodes

public java.util.ArrayList<Node> getNodes()
Returns a collection of all subnodes.

Returns:

setUserData

public void setUserData(java.lang.String title,
                        java.lang.Object data)
Stores an trait that can be identified by the given identifier.

Parameters:
title - identifier
data - data

getUserData

public java.lang.Object getUserData(java.lang.String title)
Returns the trait that can be identified by the given title.

Parameters:
title -
Returns:

getUserDataList

public java.lang.Object[] getUserDataList()
Returns a array of all traits.

Returns:
list of all saved userdatas.

getParent

public Node getParent()
Returns the cluster node, i the node is a subnode.

Returns:
if the node is a subnode, it returns the cluster node, else null.

getFamilieRank

public int getFamilieRank()
Returns the node's familie id.

Returns:
familie id

setFamilieRank

public void setFamilieRank(int familieRank)
Sets the node's familie id.

Parameters:
familieRank - new familie id

getParentsAndChilds

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

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

getParentsAndChilds

public java.util.Set<Node> getParentsAndChilds()
Returns a collection of all ancestors and successor.

Parameters:
node - The node
Returns:
a collection of all ancestors and successors

getParents

public java.util.Set<Node> getParents()
Returns a collection of all ancestors.

Returns:
a collection of all ancestors.

getParents

public java.util.Set<Node> getParents(int max)
Returns a collection of all ancestors. The parameter max defines the number of max generations, which should be considered.

Parameters:
Number - the number of max generations which should be considered.
Returns:
a collection of ancestors

getChilds

public java.util.Set<Node> getChilds()
Returns a collection of all successor.

Returns:
a collection of all successor.

getChilds

public java.util.Set<Node> getChilds(int max)
Returns a collection of all successor. You can define the number of max generations, which should be considered.

Parameters:
Number - Number the number of max generations which should be considered.
Returns:
list of successor

getIdDad

public java.lang.Object getIdDad()
Returns the node's dad id.

Returns:
the node's dad id

setIdDad

public void setIdDad(java.lang.Object idDad)
Sets the node's dad id.

Parameters:
idDad - dad's id.

getIdMom

public java.lang.Object getIdMom()
Returns the node's mom id.

Returns:
the node's mom id

setIdMom

public void setIdMom(java.lang.Object idMom)
Sets the node's mom id.

Parameters:
idDad - mom's id.

getNodeCount

public int getNodeCount()
Returns the number of sub nodes.

Returns:
number of sub nodes.

getDegree

public int getDegree()
Returns the number of outgoing and ingoing edges.

Returns:
the number of outgoing and ingoing edges

hasParents

public boolean hasParents()
Returns true, if the node has parents.


getPathTo

public java.util.Set<Node> getPathTo(Node node)
Returns a collection of all Nodes on the path between this node and the given node.

Parameters:
node -
Returns:
a collection of nodes, which are on the path between this node and the given node.

getLevel

public int getLevel()
Returns the node's level in hierarchy.

Returns:
node's level

getHierarchy

public Hierarchy getHierarchy()
Returns the node's hierarchy.

Returns:
the node's hierarchy.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object