JGAP

org.jgap.supergenes
Class Validator

java.lang.Object
  extended by org.jgap.supergenes.Validator
All Implemented Interfaces:
SupergeneValidator

public abstract class Validator
extends java.lang.Object
implements SupergeneValidator

The abstract supergeneValidator, hiding the getPersisten() and setFromPersistent() methods that are not always required.

Since:
2.0

Constructor Summary
Validator(Configuration a_conf)
           
 
Method Summary
 Configuration getConfiguration()
           
 java.lang.String getPersistent()
           The default implementation returns an empty string.
abstract  boolean isValid(Gene[] a_genes, Supergene a_for_supergene)
          Return true if this gene combination is valid for the given supergene
 void setFromPersistent(java.lang.String a_from)
          Set a persistend string representation (if needed) for this validator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Validator

public Validator(Configuration a_conf)
Method Detail

isValid

public abstract boolean isValid(Gene[] a_genes,
                                Supergene a_for_supergene)
Return true if this gene combination is valid for the given supergene

Specified by:
isValid in interface SupergeneValidator

getPersistent

public java.lang.String getPersistent()
The default implementation returns an empty string.

Specified by:
getPersistent in interface SupergeneValidator
Returns:
persistent string representation (if needed) of this validator. The method name is different allowing the same class to implement both Supergene and supergeneValidator.

setFromPersistent

public void setFromPersistent(java.lang.String a_from)
Set a persistend string representation (if needed) for this validator. The method name is different allowing the same class to implement both Supergene and supergeneValidator. The default implementation does nothing.

Specified by:
setFromPersistent in interface SupergeneValidator

getConfiguration

public Configuration getConfiguration()
Returns:
the configuration used
Since:
3.0

JGAP