KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Non-abstract Supergene ued for testing purposes only.
16  *
17  * @author Klaus Meffert
18  * @since 3.0
19  */

20 public class InstantiableSupergeneForTest
21     extends AbstractSupergene {
22   /** String containing the CVS revision. Read out via reflection!*/
23   private final static String JavaDoc CVS_REVISION = "$Revision: 1.3 $";
24
25   public InstantiableSupergeneForTest(final Configuration a_config,
26                                       Gene[] a_genes)
27       throws InvalidConfigurationException {
28     super(a_config, a_genes);
29   }
30
31   public InstantiableSupergeneForTest(final Configuration a_config)
32       throws InvalidConfigurationException {
33     super(a_config, new Gene[] {});
34   }
35
36   public InstantiableSupergeneForTest()
37       throws InvalidConfigurationException {
38     this(Genotype.getStaticConfiguration());
39   }
40
41   public boolean isValid(Gene[] a_gene) {
42     return true;
43   };
44 }
45 /**
46  * Test implementation of a validator. Always returns true (i.e. valid).
47  *
48  * @author Klaus Meffert
49  * @since 3.0
50  */

51 class TestValidator
52     extends Validator {
53   public TestValidator(final Configuration a_conf) {
54     super(a_conf);
55   }
56
57   public boolean isValid(Gene[] a_gene, Supergene a_supergene) {
58     return true;
59   }
60 }
61
Popular Tags