cdm/src/main/java/ucar/nc2/dataset/EnhanceScaleMissingUnsignedImpl.java
public static int rank(DataType dataType) {
    if (dataType == null) {
      return -1;
    }

    switch (dataType) {
      case BYTE:   return 0;
      case UBYTE:  return 1;
      case SHORT:  return 2;
      case USHORT: return 3;
      case INT:    return 4;
      case UINT:   return 5;
      case LONG:   return 6;
      case ULONG:  return 7;
      case FLOAT:  return 8;
      case DOUBLE: return 9;
      default:     return -1;
    }
  }
public static int rank(DataType dataType) {
    if (dataType == null) {
      return -1;
    }

    switch (dataType) {
      case BYTE:   return 0;
      case UBYTE:  return 1;
      case SHORT:  return 2;
      case USHORT: return 3;
      case INT:    return 4;
      case UINT:   return 5;
      case LONG:   return 6;
      case ULONG:  return 7;
      case FLOAT:  return 8;
      case DOUBLE: return 9;
      default:     return -1;
    }
  }
public static int rank ( DataType dataType ) { if ( dataType == null ) { return - 1 ; } switch ( dataType ) { case BYTE : return 0 ; case UBYTE : return 1 ; case SHORT : return 2 ; case USHORT : return 3 ; case INT : return 4 ; case UINT : return 5 ; case LONG : return 6 ; case ULONG : return 7 ; case FLOAT : return 8 ; case DOUBLE : return 9 ; default : return - 1 ; } }
Returns a distinct integer for each of the {@link DataType#isNumeric() numeric} data types that can be used to
(roughly) order them by the range of the DataType. {@code BYTE < UBYTE < SHORT < USHORT < INT < UINT <
LONG < ULONG < FLOAT < DOUBLE}. {@code -1} will be returned for all non-numeric data types.

@param dataType  a numeric data type.
@return  a distinct integer for each of the numeric data types that can be used to (roughly) order them by size.
Returns a distinct integer for each of the { @link DataType#isNumeric () numeric } data types that can be used to ( roughly ) order them by the range of the DataType . { @code BYTE < UBYTE < SHORT < USHORT < INT < UINT < LONG < ULONG < FLOAT < DOUBLE } . { @code - 1 } will be returned for all non - numeric data types .