public class Grib2Index extends GribIndex
GribIndex index = new GribIndex(); if (!index.readIndex(path)) index.makeIndex(path); for (Grib2SectionGridDefinition gds : index.getGds()) { if (gdsSet.get(gds.calcCRC()) == null) gdsSet.put(gds.calcCRC(), gds); } for (Grib2Record gr : index.getRecords()) { gr.setFile(fileno); Grib2Pds pds = gr.getPDSsection().getPDS(); int discipline = gr.getDiscipline(); int id = gr.cdmVariableHash(); Grib2ParameterBean bean = pdsSet.get(id); if (bean == null) { bean = new Grib2ParameterBean(gr); pdsSet.put(id, bean); params.add(bean); } bean.addRecord(gr); }
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MAGIC_START |
static int |
ScanModeMissing |
Constructor and Description |
---|
Grib2Index() |
Modifier and Type | Method and Description |
---|---|
java.util.List<Grib2SectionGridDefinition> |
getGds() |
int |
getNRecords()
The number of records in the index.
|
java.util.List<Grib2Record> |
getRecords() |
static void |
main(java.lang.String[] args) |
boolean |
makeIndex(java.lang.String filename,
RandomAccessFile dataRaf)
Make the gbx9 index file.
|
boolean |
readIndex(java.lang.String filename,
long gribLastModified) |
boolean |
readIndex(java.lang.String filename,
long gribLastModified,
CollectionUpdateType force)
Read the gbx9 index file.
|
getChangeChecker, open, readOrCreateIndexFromSingleFile
public static final java.lang.String MAGIC_START
public static final int ScanModeMissing
public java.util.List<Grib2SectionGridDefinition> getGds()
public java.util.List<Grib2Record> getRecords()
public int getNRecords()
GribIndex
getNRecords
in class GribIndex
public boolean readIndex(java.lang.String filename, long gribLastModified) throws java.io.IOException
java.io.IOException
public boolean readIndex(java.lang.String filename, long gribLastModified, CollectionUpdateType force) throws java.io.IOException
GribIndex
readIndex
in class GribIndex
filename
- location of the data filegribLastModified
- last modified date of the data fileforce
- rewrite? always, test, nocheck, neverjava.io.IOException
- on io errorpublic boolean makeIndex(java.lang.String filename, RandomAccessFile dataRaf) throws java.io.IOException
GribIndex
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException