org.jgap.supergenes
Class Validator

java.lang.Object
  extended byorg.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.

Author:
Audrius Meskauskas

Constructor Summary
Validator()
           
 
Method Summary
 java.lang.String getPersistent()
          Get a persistent string representation (if needed) of this validator. The name is different allowing the same class to implement both Supergene and supergeneValidator. The default implementation returns an empty string.
abstract  boolean isValid(Gene[] genes, Supergene 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. The name is different allowing the same class to implement both Supergene and supergeneValidator. The default implementation does nothing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Validator

public Validator()
Method Detail

isValid

public abstract boolean isValid(Gene[] genes,
                                Supergene 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()
Get a persistent string representation (if needed) of this validator. The name is different allowing the same class to implement both Supergene and supergeneValidator. The default implementation returns an empty string.

Specified by:
getPersistent in interface supergeneValidator

setFromPersistent

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

Specified by:
setFromPersistent in interface supergeneValidator