Package ucar.nc2.iosp.grid
Class GridIndex
- java.lang.Object
-
- ucar.nc2.iosp.grid.GridIndex
-
public final class GridIndex extends Object
An "in memory" index for 2D grid files. Has list of GridRecord (Parameter), GridDefRecord (GDS) and attributes.
-
-
Field Summary
Fields Modifier and Type Field Description static String
current_index_version
used to check versions of already created indexes.String
filename
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGlobalAttribute(String name, String value)
adds a GlobalAttribute to the index.void
addGridRecord(GridRecord gr)
adds a GridRecord to the index.void
addHorizCoordSys(GridDefRecord gds)
adds a GridDefRecord to the index.void
finish()
compares GDS for duplicatesMap<String,String>
getGlobalAttributes()
GlobalAttributes of index.int
getGridCount()
Get the count of GridRecordsList<GridRecord>
getGridRecords()
Grib records of index, one for each parameter.List<GridDefRecord>
getHorizCoordSys()
GridDefs of the index.
-
-
-
Field Detail
-
current_index_version
public static final String current_index_version
used to check versions of already created indexes.- See Also:
- Constant Field Values
-
filename
public final String filename
-
-
Constructor Detail
-
GridIndex
public GridIndex(String filename)
Constructor for creating an Index from the Grid file. Use the addXXX() methods.- Parameters:
filename
- name of data file, for debugging
-
-
Method Detail
-
getGlobalAttributes
public final Map<String,String> getGlobalAttributes()
GlobalAttributes of index.- Returns:
- HashMap of type GlobalAttributes.
-
getGridRecords
public final List<GridRecord> getGridRecords()
Grib records of index, one for each parameter.- Returns:
- list of type GridRecord.
-
getHorizCoordSys
public final List<GridDefRecord> getHorizCoordSys()
GridDefs of the index.- Returns:
- list of type GridDef.
-
addGridRecord
public final void addGridRecord(GridRecord gr)
adds a GridRecord to the index.- Parameters:
gr
- GridRecord
-
addHorizCoordSys
public final void addHorizCoordSys(GridDefRecord gds)
adds a GridDefRecord to the index.- Parameters:
gds
- GdsRecord
-
addGlobalAttribute
public final void addGlobalAttribute(String name, String value)
adds a GlobalAttribute to the index.- Parameters:
name
- GlobalAttributevalue
- String
-
getGridCount
public int getGridCount()
Get the count of GridRecords- Returns:
- the count of GridRecords
-
finish
public void finish()
compares GDS for duplicates
-
-