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 ArraybytesToArray(byte[] in, DataType type, ByteOrder order)static DataTypegetAttributeDataType(Attribute attribute, DataType.Signedness signedness)static DataTypelargestOf(DataType... dataTypes)static DataTypenextLarger(DataType dataType)Returns the smallest numeric data type that: can hold a larger integer thandataTypecan if integral, has the same signedness asdataTypestatic intrank(DataType dataType)
-
-
-
Method Detail
-
nextLarger
public static DataType nextLarger(DataType dataType)
Returns the smallest numeric data type that:- can hold a larger integer than
dataTypecan - if integral, has the same signedness as
dataType
The returned type is intended to be just big enough to hold the result of performing an unsigned conversion of a value of the smaller type. For example, theArgument Result BYTE SHORT UBYTE USHORT SHORT INT USHORT UINT INT LONG UINT ULONG LONG DOUBLE ULONG DOUBLE Any other data type Just return argument bytevalue-106equals150when 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)
-
-