Class StationTableImpl

java.lang.Object
ucar.unidata.metdata.StationTableImpl
All Implemented Interfaces:
StationTable
Direct Known Subclasses:
NamedStationTable

public class StationTableImpl extends Object implements StationTable
Table of reporting stations.

Version:
$Revision: 1.11 $ $Date: 2006/08/18 21:31:58 $
Author:
$Author: jeffmc $
  • Field Details

    • stations

      protected List stations
    • byId_

      protected final Map byId_
      Map of stations
  • Constructor Details

    • StationTableImpl

      public StationTableImpl()
      Create a new StationTableImpl
  • Method Details

    • getMap

      protected Map getMap()
      Have this method here so derived classes know when anything was requested of this station table. This allows them to lazily create the stations, etc.
      Returns:
      station map
    • add

      public boolean add(Station stn)
      Add a station to the table
      Parameters:
      stn - station to add
      Returns:
      true if the station was not already in the table
    • add

      public boolean add(Station stn, boolean onlyIfNotInMap)
      Add a station to the table
      Parameters:
      stn - station to add
      onlyIfNotInMap -
      Returns:
      true if the station was not already in the table
    • remove

      public Station remove(Station stn)
      Remove a station from the table
      Parameters:
      stn - station to remove
      Returns:
      the station being removed or null if it is not in the table
    • remove

      public Station remove(String id)
      Remove a station from the table by it's id
      Parameters:
      id - station identifier
      Returns:
      station mapped to the id, or null if none
    • get

      public Station get(String identifier)
      Lookup Station by Identifier
      Specified by:
      get in interface StationTable
      Parameters:
      identifier - the station identifier
      Returns:
      the station in the table
    • keySet

      public Set keySet()
      Returns the set of identifiers
      Specified by:
      keySet in interface StationTable
      Returns:
      Set of identifiers
    • size

      public int size()
      Returns the number of stations in this table
      Specified by:
      size in interface StationTable
      Returns:
      number of stations in the table
    • values

      public Collection values()
      Returns a collection view of the Station values contained in this table.
      Specified by:
      values in interface StationTable
      Returns:
      the collection of stations