org.onebusaway.federations.impl
Class FederatedServiceCollectionImpl

java.lang.Object
  extended by org.onebusaway.federations.impl.FederatedServiceCollectionImpl
All Implemented Interfaces:
FederatedServiceCollection

public class FederatedServiceCollectionImpl
extends Object
implements FederatedServiceCollection

A basic FederatedServiceCollection implementation that provides methods for query a set of FederatedService instances. See the static factory method create(List, Class) for a convenient way of constructing a FederatedServiceCollectionImpl from a set of FederatedService instances of a particular type.

Author:
bdferris
See Also:
FederatedService, FederatedServiceCollection

Constructor Summary
FederatedServiceCollectionImpl()
           
FederatedServiceCollectionImpl(Map<FederatedService,Map<String,List<CoordinateBounds>>> services)
           
 
Method Summary
static
<T extends FederatedService>
FederatedServiceCollectionImpl
create(List<T> serviceProviders, Class<T> serviceInterface)
           
 Set<FederatedService> getAllServices()
          FederatedServiceCollection Interface
 FederatedService getServiceForAgencyId(String agencyId)
           
 FederatedService getServiceForAgencyIds(Iterable<String> agencyIds)
           
 FederatedService getServiceForBounds(CoordinateBounds bounds)
           
 FederatedService getServiceForBounds(double lat1, double lon1, double lat2, double lon2)
           
 FederatedService getServiceForLocation(double lat, double lon)
           
 FederatedService getServiceForLocations(List<CoordinatePoint> points)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FederatedServiceCollectionImpl

public FederatedServiceCollectionImpl(Map<FederatedService,Map<String,List<CoordinateBounds>>> services)

FederatedServiceCollectionImpl

public FederatedServiceCollectionImpl()
Method Detail

create

public static <T extends FederatedService> FederatedServiceCollectionImpl create(List<T> serviceProviders,
                                                                                 Class<T> serviceInterface)

getAllServices

public Set<FederatedService> getAllServices()
FederatedServiceCollection Interface

Specified by:
getAllServices in interface FederatedServiceCollection

getServiceForAgencyId

public FederatedService getServiceForAgencyId(String agencyId)
                                       throws ServiceAreaServiceException
Specified by:
getServiceForAgencyId in interface FederatedServiceCollection
Throws:
ServiceAreaServiceException

getServiceForAgencyIds

public FederatedService getServiceForAgencyIds(Iterable<String> agencyIds)
                                        throws ServiceAreaServiceException
Specified by:
getServiceForAgencyIds in interface FederatedServiceCollection
Throws:
ServiceAreaServiceException

getServiceForBounds

public FederatedService getServiceForBounds(CoordinateBounds bounds)
                                     throws ServiceAreaServiceException
Specified by:
getServiceForBounds in interface FederatedServiceCollection
Throws:
ServiceAreaServiceException

getServiceForBounds

public FederatedService getServiceForBounds(double lat1,
                                            double lon1,
                                            double lat2,
                                            double lon2)
                                     throws ServiceAreaServiceException
Specified by:
getServiceForBounds in interface FederatedServiceCollection
Throws:
ServiceAreaServiceException

getServiceForLocation

public FederatedService getServiceForLocation(double lat,
                                              double lon)
                                       throws ServiceAreaServiceException
Specified by:
getServiceForLocation in interface FederatedServiceCollection
Throws:
ServiceAreaServiceException

getServiceForLocations

public FederatedService getServiceForLocations(List<CoordinatePoint> points)
                                        throws ServiceAreaServiceException
Specified by:
getServiceForLocations in interface FederatedServiceCollection
Throws:
ServiceAreaServiceException


Copyright © 2011 OneBusAway. All Rights Reserved.