Package ucar.nc2.filter
Class FilterHelpers
- java.lang.Object
-
- ucar.nc2.filter.FilterHelpers
-
public class FilterHelpers extends Object
-
-
Constructor Summary
Constructors Constructor Description FilterHelpers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
arrayToBytes(Array arr, DataType type, ByteOrder order)
static Array
bytesToArray(byte[] in, DataType type, ByteOrder order)
static DataType
getAttributeDataType(Attribute attribute, DataType.Signedness signedness)
static DataType
largestOf(DataType... dataTypes)
static DataType
nextLarger(DataType dataType)
Returns the smallest numeric data type that: can hold a larger integer thandataType
can if integral, has the same signedness asdataType
static int
rank(DataType dataType)
-
-
-
Method Detail
-
nextLarger
public static DataType nextLarger(DataType dataType)
Returns the smallest numeric data type that:- can hold a larger integer than
dataType
can - if integral, has the same signedness as
dataType
Argument Result BYTE SHORT UBYTE USHORT SHORT INT USHORT UINT INT LONG UINT ULONG LONG DOUBLE ULONG DOUBLE Any other data type Just return argument byte
value-106
equals150
when interpreted as unsigned. That won't fit in a (signed)byte
, but it will fit in ashort
.- Parameters:
dataType
- an integral data type.- Returns:
- the next larger type.
- can hold a larger integer than
-
getAttributeDataType
public static DataType getAttributeDataType(Attribute attribute, DataType.Signedness signedness)
-
rank
public static int rank(DataType dataType)
-
-