public class Grib1Index extends GribIndex
Grib1Index index = new Grib1Index();
if (!index.readIndex(path))
index.makeIndex(path);
for (Grib1SectionGridDefinition gds : index.getGds()) {
if (gdsSet.get(gds.calcCRC()) == null)
gdsSet.put(gds.calcCRC(), gds);
}
for (Grib1Record gr : index.getRecords()) {
gr.setFile(fileno);
Grib1Pds pds = gr.getPDSsection().getPDS();
int discipline = gr.getDiscipline();
int id = gr.cdmVariableHash();
Grib1ParameterBean bean = pdsSet.get(id);
if (bean == null) {
bean = new Grib1ParameterBean(gr);
pdsSet.put(id, bean);
params.add(bean);
}
bean.addRecord(gr);
}
| Modifier and Type | Field and Description |
|---|---|
static String |
MAGIC_START |
| Constructor and Description |
|---|
Grib1Index() |
| Modifier and Type | Method and Description |
|---|---|
List<Grib1SectionGridDefinition> |
getGds() |
int |
getNRecords()
The number of records in the index.
|
List<Grib1Record> |
getRecords() |
static void |
main(String[] args) |
boolean |
makeIndex(String filename,
RandomAccessFile dataRaf)
Make the gbx9 index file.
|
boolean |
readIndex(String filename,
long gribLastModified) |
boolean |
readIndex(String filename,
long gribLastModified,
CollectionManager.Force force)
Read the gbx9 index file.
|
getChangeChecker, makeGribCollectionFromSingleFile, readOrCreateIndexFromSingleFilepublic static final String MAGIC_START
public List<Grib1SectionGridDefinition> getGds()
public List<Grib1Record> getRecords()
public int getNRecords()
GribIndexgetNRecords in class GribIndexpublic boolean readIndex(String filename, long gribLastModified) throws IOException
IOExceptionpublic boolean readIndex(String filename, long gribLastModified, CollectionManager.Force force) throws IOException
GribIndexreadIndex in class GribIndexfilename - location of the data filegribLastModified - last modified date of the data fileforce - always, test or nocheckIOException - on io errorpublic boolean makeIndex(String filename, RandomAccessFile dataRaf) throws IOException
GribIndexmakeIndex in class GribIndexfilename - location of the data filedataRaf - already opened data raf; may be nullIOException - on io errorpublic static void main(String[] args) throws IOException
IOExceptionCopyright © 1999–2014 UCAR/Unidata. All rights reserved.