class EncodedValueOld {

    public long setValue(long flags, long value) {
        // scale value
        value = Math.round(value / factor);
        checkValue((long) (value * factor));
        value <<= shift;

        // clear value bits
        flags &= ~mask;

        // set value
        return flags | value;
    }

    public  EncodedValueOld(String name, int shift, int bits, double factor, long defaultValue, int maxValue);
    public  EncodedValueOld(String name, int shift, int bits, double factor, long defaultValue, int maxValue, boolean allowZero);

}