JGAP

org.jgap.impl
Class DefaultInitializer

java.lang.Object
  extended by org.jgap.impl.DefaultInitializer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IHandler, IInitializer, ICloneable

public class DefaultInitializer
extends java.lang.Object
implements IInitializer, ICloneable, java.io.Serializable

Default implementation for initializing Chromosomes.

Since:
2.6
See Also:
Serialized Form

Constructor Summary
DefaultInitializer()
           
 
Method Summary
 java.lang.Object clone()
           
 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.
 java.lang.Object perform(java.lang.Object a_obj, java.lang.Class a_class, java.lang.Object a_params)
          Performs a task for the given object or class.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInitializer

public DefaultInitializer()
Method Detail

isHandlerFor

public boolean isHandlerFor(java.lang.Object a_obj,
                            java.lang.Class a_class)
Description copied from interface: IHandler
Determines whether the handler is suitable for the given object instance or class.

Specified by:
isHandlerFor in interface IHandler
Parameters:
a_obj - the object instance to check
a_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

perform

public java.lang.Object perform(java.lang.Object a_obj,
                                java.lang.Class a_class,
                                java.lang.Object a_params)
                         throws java.lang.Exception
Description copied from interface: IHandler
Performs a task for the given object or class. For some handlers, additional parameters are necessary, which could be provided.

Specified by:
perform in interface IHandler
Parameters:
a_obj - the object instance to perform the handler task for
a_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

clone

public java.lang.Object clone()
Specified by:
clone in interface ICloneable
Overrides:
clone in class java.lang.Object
Returns:
deep clone of this instance
Since:
3.2

JGAP