KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > supergenes > Validator


1 /*
2  * This file is part of JGAP.
3  *
4  * JGAP offers a dual license model containing the LGPL as well as the MPL.
5  *
6  * For licencing information please see the file license.txt included with JGAP
7  * or have a look at the top of class org.jgap.Chromosome which representatively
8  * includes the JGAP license policy applicable for any file delivered with JGAP.
9  */

10 package org.jgap.supergenes;
11
12 import org.jgap.*;
13
14 /**
15  * The abstract supergeneValidator, hiding the getPersisten()
16  * and setFromPersistent() methods that are not always required.
17  *
18  * @author Audrius Meskauskas
19  * @since 2.0
20  */

21 public abstract class Validator
22     implements SupergeneValidator {
23   /** String containing the CVS revision. Read out via reflection!*/
24   private final static String JavaDoc CVS_REVISION = "$Revision: 1.8 $";
25
26   private transient Configuration m_conf;
27
28   public Validator(Configuration a_conf) {
29     m_conf = a_conf;
30   }
31
32   /** {@inheritDoc} */
33   public abstract boolean isValid(Gene[] a_genes, Supergene a_for_supergene);
34
35   /** {@inheritDoc}
36    * The default implementation returns an empty string. */

37   public String JavaDoc getPersistent() {
38     return "";
39   }
40
41   /** {@inheritDoc}
42    * The default implementation does nothing. */

43   public void setFromPersistent(final String JavaDoc a_from) {
44   }
45
46   /**
47    * @return the configuration used
48    *
49    * @author Klaus Meffert
50    * @since 3.0
51    */

52   public Configuration getConfiguration() {
53     return m_conf;
54   }
55 }
56
Popular Tags