01: /*
02: * This file is part of JGAP.
03: *
04: * JGAP offers a dual license model containing the LGPL as well as the MPL.
05: *
06: * For licensing information please see the file license.txt included with JGAP
07: * or have a look at the top of class org.jgap.Chromosome which representatively
08: * includes the JGAP license policy applicable for any file delivered with JGAP.
09: */
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 implements SupergeneValidator {
22: /** String containing the CVS revision. Read out via reflection!*/
23: private final static String CVS_REVISION = "$Revision: 1.9 $";
24:
25: private transient Configuration m_conf;
26:
27: public Validator(Configuration a_conf) {
28: m_conf = a_conf;
29: }
30:
31: /** {@inheritDoc} */
32: public abstract boolean isValid(Gene[] a_genes,
33: Supergene a_for_super gene);
34:
35: /** {@inheritDoc}
36: * The default implementation returns an empty string. */
37: public String getPersistent() {
38: return "";
39: }
40:
41: /** {@inheritDoc}
42: * The default implementation does nothing. */
43: public void setFromPersistent(final String 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: }
|