Package ucar.nc2.write
Class NetcdfFormatWriter.WriteConfig
- java.lang.Object
-
- ucar.nc2.write.NetcdfFormatWriter.WriteConfig
-
- Enclosing class:
- NetcdfFormatWriter
public class NetcdfFormatWriter.WriteConfig extends Object
Fluid API for writing.
-
-
Constructor Summary
Constructors Constructor Description WriteConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetcdfFormatWriter.WriteConfig
forVariable(String varName)
Write to this named Variable.NetcdfFormatWriter.WriteConfig
forVariable(Variable v)
Write to this Variable.NetcdfFormatWriter.WriteConfig
withArray(Array<?> values)
The values to write.NetcdfFormatWriter.WriteConfig
withOrigin(int... origin)
The starting element as an int[].NetcdfFormatWriter.WriteConfig
withOrigin(Index origin)
The starting element, ie write(int[] origin, int[] shape).NetcdfFormatWriter.WriteConfig
withPrimitiveArray(Object primArray)
The values to write as a 1D java primitive array, eg float[].NetcdfFormatWriter.WriteConfig
withShape(int... shape)
Shape of primitive array to write, ie write(int[] origin, int[] shape).NetcdfFormatWriter.WriteConfig
withString(String sval)
For writing a String into a CHAR Variable.void
write()
Do the write to the file, agter constructing the WriteConfig.
-
-
-
Method Detail
-
forVariable
public NetcdfFormatWriter.WriteConfig forVariable(Variable v)
Write to this Variable. Set Variable or Variable name.
-
forVariable
public NetcdfFormatWriter.WriteConfig forVariable(String varName)
Write to this named Variable. Set Variable or Variable name.
-
withOrigin
public NetcdfFormatWriter.WriteConfig withOrigin(Index origin)
The starting element, ie write(int[] origin, int[] shape). If not set, origin of 0 is assumed.
-
withOrigin
public NetcdfFormatWriter.WriteConfig withOrigin(int... origin)
The starting element as an int[].
-
withArray
public NetcdfFormatWriter.WriteConfig withArray(Array<?> values)
The values to write. ArrayType must match the Variable.
-
withPrimitiveArray
public NetcdfFormatWriter.WriteConfig withPrimitiveArray(Object primArray)
The values to write as a 1D java primitive array, eg float[].
-
withShape
public NetcdfFormatWriter.WriteConfig withShape(int... shape)
Shape of primitive array to write, ie write(int[] origin, int[] shape). Only needed if you use withPrimitiveArray, otherwise the Array values' shape is used. Use v.getShape() if shape is not set, and Array values is not set.
-
withString
public NetcdfFormatWriter.WriteConfig withString(String sval)
For writing a String into a CHAR Variable.
-
write
public void write() throws IOException, InvalidRangeException, IllegalArgumentException
Do the write to the file, agter constructing the WriteConfig.- Throws:
IllegalArgumentException
- when not configured correctly.IOException
InvalidRangeException
- See Also:
NetcdfFormatWriter.write(Variable, ucar.array.Index, ucar.array.Array)
-
-