Package org.opt4j.start
Class Opt4JModule
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- org.opt4j.start.Opt4JModule
-
- All Implemented Interfaces:
com.google.inject.Module
- Direct Known Subclasses:
ArchiveModule,ConstraintDominationModule,CoolingScheduleModule,IndividualCompleterModule,MatingModule,NormalizerModule,OperatorModule,OptimizerModule,ProblemModule,RandomModule,SelectorModule,VisualizationModule
public abstract class Opt4JModule extends com.google.inject.AbstractModuleTheOpt4JModuleis the superclass for all modules.
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.inject.ScopeSINGLETONThe singleton scope.
-
Constructor Summary
Constructors Constructor Description Opt4JModule()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddControlListener(Class<? extends ControlListener> listener)Adds anControlListener.voidaddIndividualStateListener(Class<? extends IndividualStateListener> listener)Adds anIndividualStateListener.voidaddOptimizerIterationListener(Class<? extends OptimizerIterationListener> listener)Adds anOptimizerIterationListener.voidaddOptimizerStateListener(Class<? extends OptimizerStateListener> listener)Adds anOptimizerStateListener.protected com.google.inject.binder.ConstantBindingBuilderbindConstant(Annotation annotation)Bind a value.protected com.google.inject.binder.ConstantBindingBuilderbindConstant(Class<? extends Annotation> annotation)Bind a value.protected com.google.inject.binder.ConstantBindingBuilderbindConstant(String value)Bind aConstant.protected com.google.inject.binder.ConstantBindingBuilderbindConstant(String value, Class<?> namespace)Bind a constant.protected abstract voidconfig()Configure the module.protected voidconfigure()static org.opt4j.start.Opt4JModule.ConstantImplconstant(String value, Class<?> namespace)Returns the implementation of theConstantannotation.voidmulti(Class<?> clazz)-
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
-
-
-
Method Detail
-
bindConstant
protected com.google.inject.binder.ConstantBindingBuilder bindConstant(Class<? extends Annotation> annotation)
Bind a value.- Parameters:
annotation- the type of annotation of the value- Returns:
- the constant binding builder that allows a binding
-
bindConstant
protected com.google.inject.binder.ConstantBindingBuilder bindConstant(Annotation annotation)
Bind a value.- Parameters:
annotation- the annotation of the value- Returns:
- the constant binding builder that allows a binding
-
configure
protected void configure()
- Specified by:
configurein classcom.google.inject.AbstractModule
-
multi
public void multi(Class<?> clazz)
-
config
protected abstract void config()
Configure the module. Bind constants, listeners, and bind arbitrary classes.- See Also:
Binder
-
constant
public static org.opt4j.start.Opt4JModule.ConstantImpl constant(String value, Class<?> namespace)
Returns the implementation of theConstantannotation.- Parameters:
value- the valuenamespace- the namespace- Returns:
- the constant annotation
-
bindConstant
protected com.google.inject.binder.ConstantBindingBuilder bindConstant(String value)
Bind aConstant.- Parameters:
value- the value from theConstantannotation with an empty namespace- Returns:
- the constant binding builder that allows a binding
-
bindConstant
protected com.google.inject.binder.ConstantBindingBuilder bindConstant(String value, Class<?> namespace)
Bind a constant.
-
addOptimizerStateListener
public void addOptimizerStateListener(Class<? extends OptimizerStateListener> listener)
Adds anOptimizerStateListener.- Parameters:
listener- the listener to be added
-
addOptimizerIterationListener
public void addOptimizerIterationListener(Class<? extends OptimizerIterationListener> listener)
Adds anOptimizerIterationListener.- Parameters:
listener- the listener to be added
-
addIndividualStateListener
public void addIndividualStateListener(Class<? extends IndividualStateListener> listener)
Adds anIndividualStateListener.- Parameters:
listener- the listener to be added
-
addControlListener
public void addControlListener(Class<? extends ControlListener> listener)
Adds anControlListener.- Parameters:
listener- the listener to be added
-
-