Clover coverage report - JGAP 3.1
Coverage timestamp: Mo Dez 11 2006 21:16:18 CET
file stats: LOC: 75   Methods: 3
NCLOC: 26   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
BaseGeneticOperator.java 0% 0% 0% 0%
coverage
 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    import java.util.*;
 13   
 14    /**
 15    * Base class for any implementation of interface GeneticOperator.
 16    *
 17    * @author Klaus Meffert
 18    * @since 3.0
 19    */
 20    public abstract class BaseGeneticOperator
 21    implements GeneticOperator, Comparable {
 22    /** String containing the CVS revision. Read out via reflection!*/
 23    private final static String CVS_REVISION = "$Revision: 1.4 $";
 24   
 25    private /*transient*/ Configuration m_configuration;
 26   
 27    /**
 28    * The only constructor in this class. Sets the immutable configuration.
 29    * @param a_configuration the configuration to set (must not be null)
 30    * @throws InvalidConfigurationException
 31    * @author Klaus Meffert
 32    * @since 3.0
 33    */
 34  0 public BaseGeneticOperator(Configuration a_configuration)
 35    throws InvalidConfigurationException {
 36  0 if (a_configuration == null) {
 37  0 throw new InvalidConfigurationException("Configuration to set may not be"
 38    +" null!");
 39    }
 40  0 m_configuration = a_configuration;
 41    }
 42   
 43    /**
 44    * @todo make returned object immutable
 45    * @return the configuration set
 46    *
 47    * @author Klaus Meffert
 48    * @since 3.0
 49    */
 50  0 public Configuration getConfiguration() {
 51  0 return m_configuration;
 52    }
 53   
 54    /**
 55    * Compares this GeneticOperator against the specified object. The result is
 56    * true if the argument is an instance of this class and is equal with respect
 57    * to the data.
 58    *
 59    * @param a_other the object to compare against
 60    * @return true: if the objects are the same, false otherwise
 61    *
 62    * @author Klaus Meffert
 63    * @since 2.6
 64    */
 65  0 public boolean equals(final Object a_other) {
 66  0 try {
 67    /**@todo also compare Configuration*/
 68  0 return compareTo(a_other) == 0;
 69    }
 70    catch (ClassCastException cex) {
 71  0 return false;
 72    }
 73    }
 74   
 75    }