ucar.nc2.iosp.mcidas
Class AreaServiceProvider

java.lang.Object
  extended by ucar.nc2.iosp.AbstractIOServiceProvider
      extended by ucar.nc2.iosp.mcidas.AreaServiceProvider
All Implemented Interfaces:
IOServiceProvider

public class AreaServiceProvider
extends AbstractIOServiceProvider

IOServiceProvider for McIDAS AREA files

Version:
$Revision: 1.3 $
Author:
IDV Development Team

Nested Class Summary
protected static class AreaServiceProvider.MakeNetcdfFile
          TODO: generalize this static class for testing
 
Field Summary
protected  AreaReader areaReader
          AREA file reader
 
Fields inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
raf
 
Constructor Summary
AreaServiceProvider()
           
 
Method Summary
 void close()
          Close this IOSP
 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?
static void main(String[] args)
          Test this.
 void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask)
          Open the service provider for reading.
 Array readData(Variable v2, Section section)
          Read the data for the variable
 
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
getDetailInfo, getFileTypeVersion, getStructureIterator, readSection, readToByteChannel, sendIospMessage, sync, syncExtend, toStringDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

areaReader

protected AreaReader areaReader
AREA file reader

Constructor Detail

AreaServiceProvider

public AreaServiceProvider()
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:
"http://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:
"http://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 interface IOServiceProvider
Overrides:
open in class AbstractIOServiceProvider
Parameters:
raf - file to read from
ncfile - 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 read
section - section infomation
Returns:
Array of data
Throws:
IOException - problem reading from file
InvalidRangeException - invalid Range
See Also:
Range

close

public void close()
           throws IOException
Close this IOSP

Specified by:
close in interface IOServiceProvider
Overrides:
close in class AbstractIOServiceProvider
Throws:
IOException - problem closing file

main

public static void main(String[] args)
                 throws IOException
Test this.

Parameters:
args - [0] input file name [0] output file name
Throws:
IOException - problem reading the file


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.