org.opentripplanner.routing.bike_rental.BikeRentalStationService 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.bike_rental;
import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.opentripplanner.routing.bike_park.BikePark;
public class BikeRentalStationService implements Serializable {
private static final long serialVersionUID = -1288992939159246764L;
private Set bikeRentalStations = new HashSet<>();
private Set bikeParks = new HashSet<>();
public Collection getBikeRentalStations() {
return bikeRentalStations;
}
public void addBikeRentalStation(BikeRentalStation bikeRentalStation) {
// Remove old reference first, as adding will be a no-op if already present
bikeRentalStations.remove(bikeRentalStation);
bikeRentalStations.add(bikeRentalStation);
}
public void removeBikeRentalStation(BikeRentalStation bikeRentalStation) {
bikeRentalStations.remove(bikeRentalStation);
}
public Collection getBikeParks() {
return bikeParks;
}
public void addBikePark(BikePark bikePark) {
// Remove old reference first, as adding will be a no-op if already present
bikeParks.remove(bikePark);
bikeParks.add(bikePark);
}
public void removeBikePark(BikePark bikePark) {
bikeParks.remove(bikePark);
}
}