MATSIM
PlanStrategyImpl.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * PlanStrategy.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2007 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package org.matsim.core.replanning;
22 
23 import java.util.ArrayList;
24 
29 
43 public final class PlanStrategyImpl extends GenericPlanStrategyImpl<Plan, Person> implements PlanStrategy {
44 
45  public final static class Builder {
47  private final ArrayList<PlanStrategyModule> modules = new ArrayList<>();
48  public Builder( final PlanSelector<Plan,Person> planSelector) {
49  this.planSelector = planSelector;
50  }
51  public final Builder addStrategyModule( final PlanStrategyModule module) {
52  this.modules.add(module);
53  return this ;
54  }
55  public final PlanStrategy build() {
56  PlanStrategyImpl impl = new PlanStrategyImpl(planSelector) ;
57  for (PlanStrategyModule module : modules) {
58  impl.addStrategyModule(module);
59  }
60  return impl;
61  }
62  }
63 
69  @Deprecated // "public" is deprecated. Please use the Builder instead. Reason: separate "construction interface" from "application interface". kai, nov'14
71  super(planSelector);
72  }
73 
74 }
PlanStrategyImpl(final PlanSelector< Plan, Person > planSelector)
final ArrayList< PlanStrategyModule > modules
final Builder addStrategyModule(final PlanStrategyModule module)
void addStrategyModule(final GenericPlanStrategyModule< T > module)
Builder(final PlanSelector< Plan, Person > planSelector)