Package org.opt4j.core.start
Class Opt4JModule
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- org.opt4j.core.start.Opt4JModule
-
- All Implemented Interfaces:
com.google.inject.Module
- Direct Known Subclasses:
ArchiveModule
,IndividualCompleterModule
,OptimizerModule
,OutputModule
,ProblemModule
,RandomModule
public abstract class Opt4JModule extends com.google.inject.AbstractModule
TheOpt4JModule
is the superclass for all modules. The class and its fields might be extended with certain annotations. SeeConstant
and theorg.opt4j.core.config.annotations
package.
-
-
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(java.lang.Class<? extends ControlListener> listener)
Adds anControlListener
.void
addIndividualStateListener(java.lang.Class<? extends IndividualStateListener> listener)
Adds anIndividualStateListener
.void
addOptimizerIterationListener(java.lang.Class<? extends OptimizerIterationListener> listener)
Adds anOptimizerIterationListener
.void
addOptimizerStateListener(java.lang.Class<? extends OptimizerStateListener> listener)
Adds anOptimizerStateListener
.com.google.inject.binder.ConstantBindingBuilder
bindConstant(java.lang.annotation.Annotation annotation)
Bind a value.com.google.inject.binder.ConstantBindingBuilder
bindConstant(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Bind a value.protected com.google.inject.binder.ConstantBindingBuilder
bindConstant(java.lang.String value)
Bind aConstant
.com.google.inject.binder.ConstantBindingBuilder
bindConstant(java.lang.String value, java.lang.Class<?> namespace)
Bind a constant.protected abstract void
config()
Configure the module.protected void
configure()
static org.opt4j.core.start.Opt4JModule.ConstantImpl
constant(java.lang.String value, java.lang.Class<?> namespace)
Returns the implementation of theConstant
annotation.protected void
multi(java.lang.Class<?> clazz)
-
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
-
-
-
Method Detail
-
bindConstant
public com.google.inject.binder.ConstantBindingBuilder bindConstant(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Bind a value.- Parameters:
annotation
- the type of annotation of the value- Returns:
- the constant binding builder that allows a binding
-
bindConstant
public com.google.inject.binder.ConstantBindingBuilder bindConstant(java.lang.annotation.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()
- Overrides:
configure
in classcom.google.inject.AbstractModule
-
multi
protected void multi(java.lang.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.core.start.Opt4JModule.ConstantImpl constant(java.lang.String value, java.lang.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(java.lang.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
public com.google.inject.binder.ConstantBindingBuilder bindConstant(java.lang.String value, java.lang.Class<?> namespace)
Bind a constant.
-
addOptimizerStateListener
public void addOptimizerStateListener(java.lang.Class<? extends OptimizerStateListener> listener)
Adds anOptimizerStateListener
.- Parameters:
listener
- the listener to be added
-
addOptimizerIterationListener
public void addOptimizerIterationListener(java.lang.Class<? extends OptimizerIterationListener> listener)
Adds anOptimizerIterationListener
.- Parameters:
listener
- the listener to be added
-
addIndividualStateListener
public void addIndividualStateListener(java.lang.Class<? extends IndividualStateListener> listener)
Adds anIndividualStateListener
.- Parameters:
listener
- the listener to be added
-
addControlListener
public void addControlListener(java.lang.Class<? extends ControlListener> listener)
Adds anControlListener
.- Parameters:
listener
- the listener to be added
-
-