KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > BaseChromosome


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;
11
12 /**
13  * Base class for any implementation of interface IChromosome.
14  *
15  * @author Klaus Meffert
16  * @since 3.0
17  */

18 public abstract class BaseChromosome
19     implements IChromosome, IInitializer {
20   /** String containing the CVS revision. Read out via reflection!*/
21   private final static String JavaDoc CVS_REVISION = "$Revision: 1.7 $";
22
23   /**
24    * The configuration object to use
25    */

26   private /*transient*/ Configuration m_configuration;
27
28   /**
29    * The only constructor in this class. Sets the immutable configuration.
30    *
31    * @param a_configuration the configuration to set
32    * @throws InvalidConfigurationException if configuration is null
33    *
34    * @author Klaus Meffert
35    * @since 3.0
36    */

37   public BaseChromosome(Configuration a_configuration)
38       throws InvalidConfigurationException {
39     if (a_configuration == null) {
40       throw new InvalidConfigurationException(
41           "Configuration to be set must not"
42           + " be null!");
43     }
44     m_configuration = a_configuration;
45   }
46
47   /**
48    * @return the configuration used
49    *
50    * @author Klaus Meffert
51    * @since 3.0
52    */

53   public Configuration getConfiguration() {
54     return m_configuration;
55   }
56
57   /**
58    * Creates and returns a copy of this object.
59    *
60    * @return a clone of this instance
61    * @throws IllegalStateException instead of CloneNotSupportedException
62    *
63    * @author Klaus Meffert
64    * @since 3.0
65    */

66   public abstract Object JavaDoc clone();
67 }
68
Popular Tags