org.opentripplanner.routing.core.FareComponent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.routing.core;
import org.opentripplanner.model.FeedScopedId;
import java.util.ArrayList;
import java.util.List;
/**
*
* FareComponent is a sequence of routes for a particular fare.
*
*/
public class FareComponent {
public FeedScopedId fareId;
public Money price;
public List routes;
public FareComponent(FeedScopedId fareId, Money amount) {
this.fareId = fareId;
price = amount;
routes = new ArrayList();
}
public void addRoute(FeedScopedId routeId) {
routes.add(routeId);
}
public String toString() {
StringBuffer buffer = new StringBuffer("FareComponent(");
buffer.append(fareId.toString());
buffer.append(", ");
buffer.append(price.toString());
buffer.append(", ");
for (FeedScopedId routeId : routes) {
buffer.append(routeId.toString());
buffer.append(", ");
}
buffer.append(")");
return buffer.toString();
}
}