|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectau.csiro.netcdf.util.NetCDFUtils
public class NetCDFUtils
A collection of netCDF specific utility functions. Copyright 2010, CSIRO Australia All rights reserved.
Field Summary | |
---|---|
static int |
NOT_FOUND
Index value to be returned when the value cannot be found in the array |
static String |
NULL_VALUE
|
Constructor Summary | |
---|---|
NetCDFUtils()
|
Method Summary | |
---|---|
static int |
lookupIndex(NetcdfFile file,
Dimension dimension,
String value)
Lookup the index of a value in a dimension. |
static List<Attribute> |
mapStringToAttributeValueList(String commaSeparatedAttributeValueString)
Converts a comma separated String into a String Attribute list. |
static List<Attribute> |
mapStringToAttributeValueList(String commaSeparatedAttributeValueString,
DataType dataType)
Converts a comma separated String into an Attribute list. |
static List<Attribute> |
readAttributesFromStream(InputStream input)
Converts an input stream into an Attribute list. |
static int |
searchCharArray(Array source,
Character value)
Search a netCDF Array containing character values stored in ascending order, i.e. |
static int |
searchFloatingPointArray(Array source,
double value,
double tolerance)
Search a netCDF Array containing floating point numeric values (double, float) stored in ascending order. |
static int |
searchIntegralArray(Array source,
long value)
Search a netCDF Array containing integer numeric values (int, long, short, byte) stored in ascending order. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NOT_FOUND
public static final String NULL_VALUE
Constructor Detail |
---|
public NetCDFUtils()
Method Detail |
---|
public static int lookupIndex(NetcdfFile file, Dimension dimension, String value) throws IOException
file
- The NetCDF file being processed.dimension
- The dimension the value comes fromvalue
- The value to be found
IOException
- If data cannot be read from the dimensionpublic static int searchIntegralArray(Array source, long value)
source
- The array to be searchedvalue
- The value to be found
public static int searchFloatingPointArray(Array source, double value, double tolerance)
source
- The array to be searchedvalue
- The value to be foundtolerance
- The comparison tolerance for floating point value comparisons
public static int searchCharArray(Array source, Character value)
source
- The array to be searchedvalue
- The value to be found
public static List<Attribute> mapStringToAttributeValueList(String commaSeparatedAttributeValueString) throws IllegalArgumentException
String
into a String Attribute
list.
commaSeparatedAttributeValueString
- a list of comma separated attribute-value pairs, e.g. attribute1=value1,attribute2=value2,...
Attribute
list.
IllegalArgumentException
- thrown if the String
can not be converted into an Attribute
list.public static List<Attribute> mapStringToAttributeValueList(String commaSeparatedAttributeValueString, DataType dataType) throws IllegalArgumentException
String
into an Attribute
list.
commaSeparatedAttributeValueString
- a list of comma separated attribute-value pairs, e.g. attribute1=value1,attribute2=value2,...dataType
- The type of attributes to be created.
Attribute
list.
IllegalArgumentException
- thrown if the String
can not be converted into an Attribute
list.public static List<Attribute> readAttributesFromStream(InputStream input) throws IOException
Attribute
list.
input
- the input stream
Attribute
list.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |