org.opt4j.core.start
Class Opt4JModule

java.lang.Object
  extended by com.google.inject.AbstractModule
      extended by 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

The Opt4JModule is the superclass for all modules.


Field Summary
static com.google.inject.Scope SINGLETON
          The singleton scope.
 
Constructor Summary
Opt4JModule()
           
 
Method Summary
 void addControlListener(java.lang.Class<? extends ControlListener> listener)
          Adds an ControlListener.
 void addIndividualStateListener(java.lang.Class<? extends IndividualStateListener> listener)
          Adds an IndividualStateListener.
 void addOptimizerIterationListener(java.lang.Class<? extends OptimizerIterationListener> listener)
          Adds an OptimizerIterationListener.
 void addOptimizerStateListener(java.lang.Class<? extends OptimizerStateListener> listener)
          Adds an OptimizerStateListener.
protected  com.google.inject.binder.ConstantBindingBuilder bindConstant(java.lang.annotation.Annotation annotation)
          Bind a value.
protected  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 a Constant.
protected  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 the Constant 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, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLETON

public static com.google.inject.Scope SINGLETON
The singleton scope.

Constructor Detail

Opt4JModule

public Opt4JModule()
Method Detail

bindConstant

protected 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

protected 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()
Specified by:
configure in class com.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 the Constant annotation.

Parameters:
value - the value
namespace - the namespace
Returns:
the constant annotation

bindConstant

protected com.google.inject.binder.ConstantBindingBuilder bindConstant(java.lang.String value)
Bind a Constant.

Parameters:
value - the value from the Constant annotation with an empty namespace
Returns:
the constant binding builder that allows a binding

bindConstant

protected com.google.inject.binder.ConstantBindingBuilder bindConstant(java.lang.String value,
                                                                       java.lang.Class<?> namespace)
Bind a constant.

Parameters:
value - the value from the Constant
namespace - the namespace from the Constant
Returns:
the constant binding builder that allows a binding

addOptimizerStateListener

public void addOptimizerStateListener(java.lang.Class<? extends OptimizerStateListener> listener)
Adds an OptimizerStateListener.

Parameters:
listener - the listener to be added

addOptimizerIterationListener

public void addOptimizerIterationListener(java.lang.Class<? extends OptimizerIterationListener> listener)
Adds an OptimizerIterationListener.

Parameters:
listener - the listener to be added

addIndividualStateListener

public void addIndividualStateListener(java.lang.Class<? extends IndividualStateListener> listener)
Adds an IndividualStateListener.

Parameters:
listener - the listener to be added

addControlListener

public void addControlListener(java.lang.Class<? extends ControlListener> listener)
Adds an ControlListener.

Parameters:
listener - the listener to be added