Документ взят из кэша поисковой машины. Адрес оригинального документа : http://angel.cs.msu.su/projects/system/toolsdoc/netcdf_java/ucar/netcdf/NetcdfFile.html
Дата изменения: Tue Dec 28 20:59:06 2004
Дата индексирования: Sun Apr 10 00:14:26 2016
Кодировка:
: Class NetcdfFile

ucar.netcdf
Class NetcdfFile

java.lang.Object
  |
  +--ucar.netcdf.AbstractNetcdf
        |
        +--ucar.netcdf.NetcdfFile
All Implemented Interfaces:
Netcdf

public class NetcdfFile
extends AbstractNetcdf

A concrete implementation of the Netcdf interface, this class provides connection to NetCDF version 1 files.

Constructors for creating new files and opening existing ones.

See Also:
Netcdf

Constructor Summary
NetcdfFile(java.io.File file, boolean readonly)
          Open existing netcdf version 1 file.
NetcdfFile(java.io.File file, boolean clobber, boolean fill, Schema template)
          Create a new netcdf version 1 file from a Schema template.
NetcdfFile(java.lang.String path, boolean ro)
          Open existing netcdf version 1 file.
NetcdfFile(java.lang.String path, boolean clobber, boolean fill, Schema template)
          Create a new netcdf version 1 file from a Schema template.
 
Method Summary
 void close()
          Close this netcdf file.
protected  void finalize()
          Ensures that the close method of this file is called when there are no more references to it.
 java.io.File getFile()
          Useful for identifying this instance among others.
 boolean getFill()
          Get the current "fill mode".
protected  Accessor ioFactory(ProtoVariable proto)
          Used when creating variables to populate this.
 void setFill(boolean pleaseFill)
          Sets the "fill mode" to the argument.
 void toCdl(java.lang.StringBuffer buf)
          Format as CDL.
 UnlimitedDimension unlimitedDimension()
          Deprecated.  
 
Methods inherited from class ucar.netcdf.AbstractNetcdf
add, contains, contains, get, getAttribute, getAttributes, getDimensions, initHashtable, iterator, putAttribute, putDimension, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NetcdfFile

public NetcdfFile(java.io.File file,
                  boolean clobber,
                  boolean fill,
                  Schema template)
           throws java.io.IOException
Create a new netcdf version 1 file from a Schema template.
Parameters:
file - the file name as File object
clobber - if true, overwrite existing
fill - if false, suppress variable pre fill
template - the Schema used as construction template. May be empty, shouldn't be null.
See Also:
setFill(boolean), Netcdf

NetcdfFile

public NetcdfFile(java.lang.String path,
                  boolean clobber,
                  boolean fill,
                  Schema template)
           throws java.io.IOException
Create a new netcdf version 1 file from a Schema template.
Parameters:
path - the file name as a String
clobber - if true, overwrite existing
fill - if false, suppress variable pre fill
template - the Schema used as construction template. May be empty, shouldn't be null.
See Also:
setFill(boolean), Netcdf

NetcdfFile

public NetcdfFile(java.io.File file,
                  boolean readonly)
           throws java.io.IOException
Open existing netcdf version 1 file.
Parameters:
file - the file name as File object
readonly - if true, open read only, else open for read and write.

NetcdfFile

public NetcdfFile(java.lang.String path,
                  boolean ro)
           throws java.io.IOException
Open existing netcdf version 1 file.
Parameters:
path - the file name as a String
readonly - if true, open read only, else open for read and write.
Method Detail

close

public void close()
           throws java.io.IOException
Close this netcdf file. The inquiry interface calls will continue to be available, but I/O accesses will fail after this call.
See Also:
RandomAccessFile.close()

getFile

public final java.io.File getFile()
Useful for identifying this instance among others.
Returns:
File object this was opened or created as.

setFill

public void setFill(boolean pleaseFill)
Sets the "fill mode" to the argument. If true (the default), new storage is prefilled with the appropriate fill value. Otherwise, this activity is suppressed and the programmer should initialize all values.
Parameters:
pleaseFill - true to fill.
See Also:
getFill()

getFill

public final boolean getFill()
Get the current "fill mode".
Returns:
true iff we are prefilling new storage with the appropriate fill value.
See Also:
setFill(boolean)

unlimitedDimension

public final UnlimitedDimension unlimitedDimension()
Deprecated.  

If this has an unlimited Dimension, return it, otherwise null. Note that this specific to NetcdfFile, not part of the Netcdf interface. Other implementations may support multiple unlimited dimensions.
Returns:
UnlimitedDimension the unlimited dimension

toCdl

public void toCdl(java.lang.StringBuffer buf)
Format as CDL.
Overrides:
toCdl in class AbstractNetcdf
Parameters:
buf - StringBuffer into which to write

ioFactory

protected Accessor ioFactory(ProtoVariable proto)
Description copied from class: AbstractNetcdf
Used when creating variables to populate this. Override in your implementation to provide the correct i/o functionality.
Overrides:
ioFactory in class AbstractNetcdf

finalize

protected void finalize()
                 throws java.lang.Throwable
Ensures that the close method of this file is called when there are no more references to it.
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable - The lack of covariance for exception specifications dictates the specificed type; it can actually only be IOException thrown by RandomAccessFile.close.
See Also:
close()