Package ucar.nc2.iosp.mcidas
Class AreaServiceProvider
- java.lang.Object
-
- ucar.nc2.iosp.AbstractIOServiceProvider
-
- ucar.nc2.iosp.mcidas.AreaServiceProvider
-
- All Implemented Interfaces:
Comparable<IOServiceProvider>
,IOServiceProvider
public class AreaServiceProvider extends AbstractIOServiceProvider
IOServiceProvider for McIDAS AREA files
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ucar.nc2.iosp.IOServiceProvider
IOServiceProvider.SortGroup
-
-
Field Summary
Fields Modifier and Type Field Description protected AreaReader
areaReader
AREA file reader-
Fields inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
location, ncfile, raf, rafOrder
-
-
Constructor Summary
Constructors Constructor Description AreaServiceProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the file.String
getFileTypeDescription()
Get a human-readable description for this file type.String
getFileTypeId()
Get a unique id for this file type.boolean
isValidFile(RandomAccessFile raf)
Is this a valid file?void
open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask)
Open the service provider for reading.void
reacquire()
Reacquire any resources like file handles Used when reactivating in cache.Array
readData(Variable v2, Section section)
Read the data for the variablevoid
release()
Release any system resources like file handles.-
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
build, buildFinish, getDetailInfo, getFileTypeVersion, getLastModified, getStructureIterator, isBuilder, readSection, readToByteChannel, readToOutputStream, sendIospMessage, setNetcdfFile, streamToByteChannel, syncExtend, toStringDebug
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ucar.nc2.iosp.IOServiceProvider
compareTo, getSortGroup
-
-
-
-
Field Detail
-
areaReader
protected AreaReader areaReader
AREA file reader
-
-
Method Detail
-
isValidFile
public boolean isValidFile(RandomAccessFile raf) throws IOException
Is this a valid file?- Parameters:
raf
- RandomAccessFile to check- Returns:
- true if a valid McIDAS AREA file
- Throws:
IOException
- problem reading file
-
getFileTypeId
public String getFileTypeId()
Description copied from interface:IOServiceProvider
Get a unique id for this file type.- Returns:
- registered id of the file type
- See Also:
- "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
-
getFileTypeDescription
public String getFileTypeDescription()
Description copied from interface:IOServiceProvider
Get a human-readable description for this file type.- Returns:
- description of the file type
- See Also:
- "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
-
open
public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException
Open the service provider for reading.- Specified by:
open
in interfaceIOServiceProvider
- Overrides:
open
in classAbstractIOServiceProvider
- Parameters:
raf
- file to read fromncfile
- netCDF file we are writing to (memory)cancelTask
- task for cancelling- Throws:
IOException
- problem reading file
-
readData
public Array readData(Variable v2, Section section) throws IOException, InvalidRangeException
Read the data for the variable- Parameters:
v2
- Variable to readsection
- section information- Returns:
- Array of data
- Throws:
IOException
- problem reading from fileInvalidRangeException
- invalid Range- See Also:
Range
-
close
public void close() throws IOException
Description copied from interface:IOServiceProvider
Close the file. It is the IOServiceProvider's job to close the file (even though it didnt open it), and to free any other resources it has used.- Specified by:
close
in interfaceIOServiceProvider
- Overrides:
close
in classAbstractIOServiceProvider
- Throws:
IOException
- if read error
-
release
public void release() throws IOException
Description copied from interface:IOServiceProvider
Release any system resources like file handles. Optional, implement only if you are able to reacquire. Used when object is made inactive in cache.- Specified by:
release
in interfaceIOServiceProvider
- Overrides:
release
in classAbstractIOServiceProvider
- Throws:
IOException
-
reacquire
public void reacquire() throws IOException
Description copied from interface:IOServiceProvider
Reacquire any resources like file handles Used when reactivating in cache.- Specified by:
reacquire
in interfaceIOServiceProvider
- Overrides:
reacquire
in classAbstractIOServiceProvider
- Throws:
IOException
-
-