org.jgap
Interface IHandler
-
- All Known Subinterfaces:
- ICloneHandler, ICompareToHandler, IInitializer
- All Known Implementing Classes:
- BaseChromosome, Chromosome, DefaultCloneHandler, DefaultCompareToHandler, DefaultInitializer
public interface IHandlerInterface for handlers capable of doing somethign specific.Such a handler acknowledges via isHandlerFor(Class) that the method perform(Object, Object) could be executed for the given class.
- Since:
- 2.6
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringCVS_REVISIONString containing the CVS revision.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description booleanisHandlerFor(java.lang.Object a_obj, java.lang.Class a_class)Determines whether the handler is suitable for the given object instance or class.java.lang.Objectperform(java.lang.Object a_obj, java.lang.Class a_class, java.lang.Object a_params)Performs a task for the given object or class.
-
-
-
Field Detail
-
CVS_REVISION
static final java.lang.String CVS_REVISION
String containing the CVS revision. Read out via reflection!- See Also:
- Constant Field Values
-
-
Method Detail
-
isHandlerFor
boolean isHandlerFor(java.lang.Object a_obj, java.lang.Class a_class)Determines whether the handler is suitable for the given object instance or class.- Parameters:
a_obj- the object instance to checka_class- the class to check, alternatively if no object instance is available (some handlers could need to get an object and would always return false if only a class is provided)- Returns:
- true: handler suitable for given object or class
- Since:
- 2.6
-
perform
java.lang.Object perform(java.lang.Object a_obj, java.lang.Class a_class, java.lang.Object a_params) throws java.lang.ExceptionPerforms a task for the given object or class. For some handlers, additional parameters are necessary, which could be provided.- Parameters:
a_obj- the object instance to perform the handler task fora_class- the class to perform the handler task for, in case no object instance is available (some handlers could need to get an object and would always throw an exception if only a class is provided)a_params- optional parameters needed for the handler to perform its task- Returns:
- Object
- Throws:
java.lang.Exception- in case of any error- Since:
- 2.6
-
-
DMelt 3.0 © DataMelt by jWork.ORG