Package ucar.unidata.metdata
Class StationTableImpl
java.lang.Object
ucar.unidata.metdata.StationTableImpl
- All Implemented Interfaces:
StationTable
- Direct Known Subclasses:
NamedStationTable
Table of reporting stations.
- Version:
- $Revision: 1.11 $ $Date: 2006/08/18 21:31:58 $
- Author:
- $Author: jeffmc $
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a station to the tableboolean
Add a station to the tableLookup Station by Identifierprotected Map
getMap()
Have this method here so derived classes know when anything was requested of this station table.keySet()
Returns the set of identifiersRemove a station from the table by it's idRemove a station from the tableint
size()
Returns the number of stations in this tablevalues()
Returns a collection view of the Station values contained in this table.
-
Field Details
-
stations
-
byId_
Map of stations
-
-
Constructor Details
-
StationTableImpl
public StationTableImpl()Create a new StationTableImpl
-
-
Method Details
-
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
Add a station to the table- Parameters:
stn
- station to add- Returns:
- true if the station was not already in the table
-
add
Add a station to the table- Parameters:
stn
- station to addonlyIfNotInMap
-- Returns:
- true if the station was not already in the table
-
remove
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
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
Lookup Station by Identifier- Specified by:
get
in interfaceStationTable
- Parameters:
identifier
- the station identifier- Returns:
- the station in the table
-
keySet
Returns the set of identifiers- Specified by:
keySet
in interfaceStationTable
- Returns:
- Set of identifiers
-
size
public int size()Returns the number of stations in this table- Specified by:
size
in interfaceStationTable
- Returns:
- number of stations in the table
-
values
Returns a collection view of the Station values contained in this table.- Specified by:
values
in interfaceStationTable
- Returns:
- the collection of stations
-