KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > IJGAPFactory


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.io.*;
13 import java.util.*;
14
15 /**
16  * Interface for central factory, see JGAPFactory.
17  *
18  * @author Klaus Meffert
19  * @since 2.6
20  */

21 public interface IJGAPFactory extends Serializable {
22   /** String containing the CVS revision. Read out via reflection!*/
23   final static String JavaDoc CVS_REVISION = "$Revision: 1.7 $";
24
25   void setParameters(Collection a_parameters);
26
27   /**
28    * @return newly created instance of a RandomGenerator
29    */

30   RandomGenerator createRandomGenerator();
31
32   /**
33    * Retrieves a clone handler capable of clone the given class.
34    * @param a_obj the object to clone (maybe null)
35    * @param a_classToClone the class to clone an object of
36    * @return the clone handler found capable of clone the given class, or null
37    * if none registered
38    *
39    * @author Klaus Meffert
40    * @since 2.6
41    */

42
43   ICloneHandler getCloneHandlerFor(Object JavaDoc a_obj, Class JavaDoc a_classToClone);
44
45   /**
46    * Registers a clone handler that could be retrieved by
47    * getCloneHandlerFor(Class).
48    * @param a_cloneHandler the ICloneHandler to register
49    * @return index of the added clone handler, needed when removeCloneHandler
50    * will be called
51    *
52    * @author Klaus Meffert
53    * @since 2.6
54    */

55
56   int registerCloneHandler(ICloneHandler a_cloneHandler);
57
58   /**
59    * Retrieves an initializer capable of initializing the Object of the given
60    * class.
61    * @param a_obj the object to init (maybe null)
62    * @param a_objToInit the object class to init
63    * @return the initializer found capable of initializing an object of the
64    * given class, or null if none registered
65    *
66    * @author Klaus Meffert
67    * @since 2.6
68    */

69   IInitializer getInitializerFor(Object JavaDoc a_obj, Class JavaDoc a_objToInit);
70
71   /**
72    * Registers an initializer that could be retrieved by
73    * getInitializerFor(Class).
74    * @param a_chromIniter the IChromosomeInitializer to register
75    * @return index of the added initializer, needed when
76    * removeChromosomeInitializer will be called
77    *
78    * @author Klaus Meffert
79    * @since 2.6
80    */

81
82   int registerInitializer(IInitializer a_chromIniter);
83
84   void setGeneticOperatorConstraint(IGeneticOperatorConstraint
85                                     a_constraint);
86
87   IGeneticOperatorConstraint getGeneticOperatorConstraint();
88
89   /**
90    * Retrieves a handler capable of comparing two instances of the given class.
91    * @param a_obj the object to compare (maybe null)
92    * @param a_classToCompareTo the class instances to compare (maybe null)
93    * @return the handler found capable of comparing instances
94    * of the given class, or null if none registered
95    *
96    * @author Klaus Meffert
97    * @since 2.6
98    */

99
100   ICompareToHandler getCompareToHandlerFor(Object JavaDoc a_obj,
101                                            Class JavaDoc 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 }
116
Popular Tags