/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package usda.weru.weps.location;

import javax.measure.Measurable;
import javax.measure.quantity.Length;
import org.jscience.geography.coordinates.LatLong;

/**
 * Provides access to the avaliable station.  Provides the anility to query based on latlong, radius and number.
 * @author Joseph Levin <joelevin@weru.ksu.edu>
 */
public interface StationDataModel {

    /**
     * Return the stations nearest a give latlong.  Returned array is sorted by
     * distance.  The nearest station being at index [0].  Some implementations
     * may have to load all the stations into memory and then apply the limits.
     * This can be an expensive call and may be best left off the EventQueue.
     *
     * It is advised that implemetations cache the results to prevent duplicate
     * executions.
     *
     * @param latlong postion to find neasest stations for
     * @param radius if is not null, limits the distance searched for stations
     * @param maxCount if greater than 0, limits the number of stations returned.
     * @return
     */
    public Station[] getNearestStations(LatLong latlong, Measurable<Length> radius, int maxCount);

    /**
     *
     * @param listener
     */
    public void addStationDataModelListener(StationDataModelListener listener);

    /**
     *
     * @param listener
     */
    public void removeStationDataModelListener(StationDataModelListener listener);

}
