pedviz.algorithms
Class ErrorChecking

java.lang.Object
  extended by pedviz.algorithms.ErrorChecking
All Implemented Interfaces:
java.lang.Runnable, Algorithm

public class ErrorChecking
extends java.lang.Object
implements Algorithm

The integrated method identifies the following basic errors: INVALID_SEX_DAD, INVALID_SEX_MOM, MISSING_DAD, MISSING_MOM, MULTI_PEDIGREES, SINGLETON.

Author:
Luki

Constructor Summary
ErrorChecking(Graph graph)
          Inits ErrorChecking.
ErrorChecking(Graph graph, java.lang.Object male, java.lang.Object female)
          Inits ErrorChecking.
ErrorChecking(java.util.Vector<Graph> graphs)
          Inits ErrorChecking for a collection of graphs.
ErrorChecking(java.util.Vector<Graph> graphs, java.lang.Object male, java.lang.Object female)
          Inits ErrorChecking for a collection of graphs.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Registers a ChangeListener.
 java.util.Vector<GraphError> getErrors()
          Returns a list with all errors.
 java.lang.String getMessage()
          Returns a short description of the algorithm.
 int getPercentComplete()
          Returns the progress in percents from 0 to 100
 void run()
          Starts the error-checking.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorChecking

public ErrorChecking(Graph graph)
Inits ErrorChecking.

Parameters:
graph - graph.

ErrorChecking

public ErrorChecking(Graph graph,
                     java.lang.Object male,
                     java.lang.Object female)
Inits ErrorChecking.

Parameters:
graph - graph
male - symbol for male (default "1")
female - symbol for female (default "2")

ErrorChecking

public ErrorChecking(java.util.Vector<Graph> graphs,
                     java.lang.Object male,
                     java.lang.Object female)
Inits ErrorChecking for a collection of graphs.

Parameters:
graphs - collection of graphs.
male - symbol for male (default "1")
female - symbol for female (default "2")

ErrorChecking

public ErrorChecking(java.util.Vector<Graph> graphs)
Inits ErrorChecking for a collection of graphs.

Parameters:
graphs - collection of graphs.
Method Detail

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
Description copied from interface: Algorithm
Registers a ChangeListener. It will be notified about the progress of the algorithm.

Specified by:
addChangeListener in interface Algorithm
Parameters:
l - Change

getMessage

public java.lang.String getMessage()
Description copied from interface: Algorithm
Returns a short description of the algorithm.

Specified by:
getMessage in interface Algorithm
Returns:
a short description of the algorithm

getPercentComplete

public int getPercentComplete()
Description copied from interface: Algorithm
Returns the progress in percents from 0 to 100

Specified by:
getPercentComplete in interface Algorithm
Returns:
the progress in percents

run

public void run()
Starts the error-checking.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in interface Algorithm

getErrors

public java.util.Vector<GraphError> getErrors()
Returns a list with all errors.

Returns:
a list with all errors.