Package org.matsim.core.controler
Class AbstractModule
- java.lang.Object
-
- org.matsim.core.controler.AbstractModule
-
- All Implemented Interfaces:
com.google.inject.Module
- Direct Known Subclasses:
CharyparNagelScoringFunctionModule
,ControlerDefaultCoreListenersModule
,ControlerDefaultsModule
,CountsModule
,DefaultMobsimModule
,DefaultPlanStrategiesModule
,DefaultPrepareForSimModule
,DependencyGraphModule
,EventsManagerModule
,ExperiencedPlanElementsModule
,ExperiencedPlansModule
,IterationTravelStatsModule
,LeastCostPathCalculatorModule
,LegHistogramModule
,LegTimesModule
,LinkStatsModule
,ModeStatsModule
,NewControlerModule
,PlansScoringModule
,PtCountsModule
,QSimModule
,ReplayEvents.Module
,ScenarioByConfigModule
,ScenarioByInstanceModule
,ScoreStatsModule
,SnapshotWritersModule
,StrategyManagerModule
,SwissRailRaptorModule
,TransitRouterModule
,TravelDisutilityModule
,TravelTimeCalculatorModule
,TripRouterModule
,VolumesAnalyzerModule
,VspPlansCleanerModule
,WithinDayModule
,WithinDayTravelTimeModule
public abstract class AbstractModule extends Object implements com.google.inject.Module
"Designed for inheritance." Extend this class, overwrite configure, and use the methods of this class to install your module. See comments in subclasses. AbstractModule is a custom version of com.google.inject.Module, with the following differences:- AbstractModule is a bit more restrictive.
- AbstractModule already has the config (as getConfig() ), which is helpful since the config contains material that has to be used to configure the services.
- Author:
- michaz
-
-
Constructor Summary
Constructors Constructor Description AbstractModule()
AbstractModule(Config config)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected com.google.inject.binder.LinkedBindingBuilder<AttributeConverter<?>>
addAttributeConverterBinding(Class<?> clazz)
protected com.google.inject.binder.LinkedBindingBuilder<ControlerListener>
addControlerListenerBinding()
protected com.google.inject.binder.LinkedBindingBuilder<EventHandler>
addEventHandlerBinding()
protected com.google.inject.binder.LinkedBindingBuilder<MobsimListener>
addMobsimListenerBinding()
protected com.google.inject.binder.LinkedBindingBuilder<PlanStrategy>
addPlanStrategyBinding(String selectorName)
protected com.google.inject.binder.LinkedBindingBuilder<RoutingModule>
addRoutingModuleBinding(String mode)
protected com.google.inject.binder.LinkedBindingBuilder<SnapshotWriter>
addSnapshotWriterBinding()
protected com.google.inject.binder.LinkedBindingBuilder<TravelDisutilityFactory>
addTravelDisutilityFactoryBinding(String mode)
protected com.google.inject.binder.LinkedBindingBuilder<TravelTime>
addTravelTimeBinding(String mode)
protected <T> com.google.inject.binder.LinkedBindingBuilder<T>
bind(com.google.inject.Key<T> key)
protected <T> com.google.inject.binder.AnnotatedBindingBuilder<T>
bind(com.google.inject.TypeLiteral<T> typeLiteral)
protected <T> com.google.inject.binder.AnnotatedBindingBuilder<T>
bind(Class<T> aClass)
protected com.google.inject.binder.LinkedBindingBuilder<TravelDisutilityFactory>
bindCarTravelDisutilityFactory()
Deprecated.better useaddTravelDisutilityFactoryBinding(String)
.protected com.google.inject.Binder
binder()
protected com.google.inject.binder.LinkedBindingBuilder<EventsManager>
bindEventsManager()
protected com.google.inject.binder.LinkedBindingBuilder<LeastCostPathCalculatorFactory>
bindLeastCostPathCalculatorFactory()
protected com.google.inject.binder.LinkedBindingBuilder<Mobsim>
bindMobsim()
protected com.google.inject.binder.LinkedBindingBuilder<TravelTime>
bindNetworkTravelTime()
Deprecated.besser useaddTravelTimeBinding(String)
.protected com.google.inject.binder.LinkedBindingBuilder<PlanSelector<Plan,Person>>
bindPlanSelectorForRemoval()
protected com.google.inject.binder.LinkedBindingBuilder<ScoringFunctionFactory>
bindScoringFunctionFactory()
protected com.google.inject.Key<TravelDisutilityFactory>
carTravelDisutilityFactoryKey()
void
configure(com.google.inject.Binder binder)
static AbstractModule
emptyModule()
protected Config
getConfig()
protected <T> javax.inject.Provider<T>
getProvider(com.google.inject.TypeLiteral<T> typeLiteral)
abstract void
install()
protected void
install(com.google.inject.Module module)
protected void
installQSimModule(AbstractQSimModule qsimModule)
protected com.google.inject.Key<TravelTime>
networkTravelTime()
static AbstractModule
override(Iterable<? extends AbstractModule> modules, AbstractModule abstractModule)
-
-
-
Constructor Detail
-
AbstractModule
public AbstractModule()
-
AbstractModule
public AbstractModule(Config config)
-
-
Method Detail
-
configure
public final void configure(com.google.inject.Binder binder)
- Specified by:
configure
in interfacecom.google.inject.Module
-
install
public abstract void install()
-
install
protected final void install(com.google.inject.Module module)
-
addEventHandlerBinding
protected final com.google.inject.binder.LinkedBindingBuilder<EventHandler> addEventHandlerBinding()
-
installQSimModule
protected final void installQSimModule(AbstractQSimModule qsimModule)
-
addControlerListenerBinding
protected final com.google.inject.binder.LinkedBindingBuilder<ControlerListener> addControlerListenerBinding()
- See Also:
ControlerListener
-
bindPlanSelectorForRemoval
protected final com.google.inject.binder.LinkedBindingBuilder<PlanSelector<Plan,Person>> bindPlanSelectorForRemoval()
- See Also:
StrategyManagerModule
-
addPlanStrategyBinding
protected final com.google.inject.binder.LinkedBindingBuilder<PlanStrategy> addPlanStrategyBinding(String selectorName)
-
bindMobsim
protected final com.google.inject.binder.LinkedBindingBuilder<Mobsim> bindMobsim()
-
bindScoringFunctionFactory
protected final com.google.inject.binder.LinkedBindingBuilder<ScoringFunctionFactory> bindScoringFunctionFactory()
-
addMobsimListenerBinding
protected final com.google.inject.binder.LinkedBindingBuilder<MobsimListener> addMobsimListenerBinding()
-
addSnapshotWriterBinding
protected final com.google.inject.binder.LinkedBindingBuilder<SnapshotWriter> addSnapshotWriterBinding()
-
addAttributeConverterBinding
protected final com.google.inject.binder.LinkedBindingBuilder<AttributeConverter<?>> addAttributeConverterBinding(Class<?> clazz)
-
bindCarTravelDisutilityFactory
@Deprecated protected final com.google.inject.binder.LinkedBindingBuilder<TravelDisutilityFactory> bindCarTravelDisutilityFactory()
Deprecated.better useaddTravelDisutilityFactoryBinding(String)
.
-
carTravelDisutilityFactoryKey
protected final com.google.inject.Key<TravelDisutilityFactory> carTravelDisutilityFactoryKey()
-
addTravelDisutilityFactoryBinding
protected final com.google.inject.binder.LinkedBindingBuilder<TravelDisutilityFactory> addTravelDisutilityFactoryBinding(String mode)
-
bindLeastCostPathCalculatorFactory
protected final com.google.inject.binder.LinkedBindingBuilder<LeastCostPathCalculatorFactory> bindLeastCostPathCalculatorFactory()
-
addTravelTimeBinding
protected final com.google.inject.binder.LinkedBindingBuilder<TravelTime> addTravelTimeBinding(String mode)
-
addRoutingModuleBinding
protected final com.google.inject.binder.LinkedBindingBuilder<RoutingModule> addRoutingModuleBinding(String mode)
-
bindEventsManager
protected final com.google.inject.binder.LinkedBindingBuilder<EventsManager> bindEventsManager()
-
bindNetworkTravelTime
@Deprecated protected final com.google.inject.binder.LinkedBindingBuilder<TravelTime> bindNetworkTravelTime()
Deprecated.besser useaddTravelTimeBinding(String)
.
-
networkTravelTime
protected final com.google.inject.Key<TravelTime> networkTravelTime()
-
bind
protected <T> com.google.inject.binder.AnnotatedBindingBuilder<T> bind(com.google.inject.TypeLiteral<T> typeLiteral)
-
bind
protected <T> com.google.inject.binder.LinkedBindingBuilder<T> bind(com.google.inject.Key<T> key)
-
binder
protected final com.google.inject.Binder binder()
-
getProvider
protected final <T> javax.inject.Provider<T> getProvider(com.google.inject.TypeLiteral<T> typeLiteral)
-
override
public static AbstractModule override(Iterable<? extends AbstractModule> modules, AbstractModule abstractModule)
-
emptyModule
public static AbstractModule emptyModule()
-
-