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.AbstractModule
TheOpt4JModule
is the superclass for all modules.
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.inject.Scope
SINGLETON
The 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 void
addControlListener(Class<? extends ControlListener> listener)
Adds anControlListener
.void
addIndividualStateListener(Class<? extends IndividualStateListener> listener)
Adds anIndividualStateListener
.void
addOptimizerIterationListener(Class<? extends OptimizerIterationListener> listener)
Adds anOptimizerIterationListener
.void
addOptimizerStateListener(Class<? extends OptimizerStateListener> listener)
Adds anOptimizerStateListener
.protected com.google.inject.binder.ConstantBindingBuilder
bindConstant(Annotation annotation)
Bind a value.protected com.google.inject.binder.ConstantBindingBuilder
bindConstant(Class<? extends Annotation> annotation)
Bind a value.protected com.google.inject.binder.ConstantBindingBuilder
bindConstant(String value)
Bind aConstant
.protected com.google.inject.binder.ConstantBindingBuilder
bindConstant(String value, Class<?> namespace)
Bind a constant.protected abstract void
config()
Configure the module.protected void
configure()
static org.opt4j.start.Opt4JModule.ConstantImpl
constant(String value, Class<?> namespace)
Returns the implementation of theConstant
annotation.void
multi(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:
configure
in 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 theConstant
annotation.- 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 theConstant
annotation 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
-
-