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
The Opt4JModule is the superclass for all modules.
  • Field Details

    • SINGLETON

      public static com.google.inject.Scope SINGLETON
      The singleton scope.
  • Constructor Details

    • Opt4JModule

      public Opt4JModule()
  • Method Details

    • 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 class com.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 the Constant annotation.
      Parameters:
      value - the value
      namespace - the namespace
      Returns:
      the constant annotation
    • bindConstant

      protected com.google.inject.binder.ConstantBindingBuilder bindConstant(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(String value, 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(Class<? extends OptimizerStateListener> listener)
      Parameters:
      listener - the listener to be added
    • addOptimizerIterationListener

      public void addOptimizerIterationListener(Class<? extends OptimizerIterationListener> listener)
      Parameters:
      listener - the listener to be added
    • addIndividualStateListener

      public void addIndividualStateListener(Class<? extends IndividualStateListener> listener)
      Parameters:
      listener - the listener to be added
    • addControlListener

      public void addControlListener(Class<? extends ControlListener> listener)
      Parameters:
      listener - the listener to be added