001: /*
002: * This file is part of JGAP.
003: *
004: * JGAP offers a dual license model containing the LGPL as well as the MPL.
005: *
006: * For licensing information please see the file license.txt included with JGAP
007: * or have a look at the top of class org.jgap.Chromosome which representatively
008: * includes the JGAP license policy applicable for any file delivered with JGAP.
009: */
010: package org.jgap;
011:
012: import java.io.*;
013: import java.util.*;
014:
015: /**
016: * Interface for central factory, see JGAPFactory.
017: *
018: * @author Klaus Meffert
019: * @since 2.6
020: */
021: public interface IJGAPFactory extends Serializable {
022: /** String containing the CVS revision. Read out via reflection!*/
023: final static String CVS_REVISION = "$Revision: 1.8 $";
024:
025: void setParameters(Collection a_parameters);
026:
027: /**
028: * @return newly created instance of a RandomGenerator
029: */
030: RandomGenerator createRandomGenerator();
031:
032: /**
033: * Retrieves a clone handler capable of clone the given class.
034: * @param a_obj the object to clone (maybe null)
035: * @param a_classToClone the class to clone an object of
036: * @return the clone handler found capable of clone the given class, or null
037: * if none registered
038: *
039: * @author Klaus Meffert
040: * @since 2.6
041: */
042:
043: ICloneHandler getCloneHandlerFor(Object a_obj, Class a_classToClone);
044:
045: /**
046: * Registers a clone handler that could be retrieved by
047: * getCloneHandlerFor(Class).
048: * @param a_cloneHandler the ICloneHandler to register
049: * @return index of the added clone handler, needed when removeCloneHandler
050: * will be called
051: *
052: * @author Klaus Meffert
053: * @since 2.6
054: */
055:
056: int registerCloneHandler(ICloneHandler a_cloneHandler);
057:
058: /**
059: * Retrieves an initializer capable of initializing the Object of the given
060: * class.
061: * @param a_obj the object to init (maybe null)
062: * @param a_objToInit the object class to init
063: * @return the initializer found capable of initializing an object of the
064: * given class, or null if none registered
065: *
066: * @author Klaus Meffert
067: * @since 2.6
068: */
069: IInitializer getInitializerFor(Object a_obj, Class a_objToInit);
070:
071: /**
072: * Registers an initializer that could be retrieved by
073: * getInitializerFor(Class).
074: * @param a_chromIniter the IChromosomeInitializer to register
075: * @return index of the added initializer, needed when
076: * removeChromosomeInitializer will be called
077: *
078: * @author Klaus Meffert
079: * @since 2.6
080: */
081:
082: int registerInitializer(IInitializer a_chromIniter);
083:
084: void setGeneticOperatorConstraint(
085: IGeneticOperatorConstraint a_constraint);
086:
087: IGeneticOperatorConstraint getGeneticOperatorConstraint();
088:
089: /**
090: * Retrieves a handler capable of comparing two instances of the given class.
091: * @param a_obj the object to compare (maybe null)
092: * @param a_classToCompareTo the class instances to compare (maybe null)
093: * @return the handler found capable of comparing instances
094: * of the given class, or null if none registered
095: *
096: * @author Klaus Meffert
097: * @since 2.6
098: */
099:
100: ICompareToHandler getCompareToHandlerFor(Object a_obj,
101: Class a_classToCompareTo);
102:
103: /**
104: * Registers a compareTo-handler that could be retrieved by
105: * getCompareToHandlerFor(Class).
106: * @param a_compareToHandler the ICompareToHandler to register
107: * @return index of the added handler, needed when removeCompareToHandler
108: * will be called
109: *
110: * @author Klaus Meffert
111: * @since 2.6
112: */
113:
114: int registerCompareToHandler(ICompareToHandler a_compareToHandler);
115: }
|