class ValueEnum extends Value {

    private String label;
    private final int value;

    private ValueEnum(String label, int value) {
        this.label = label;
        this.value = value;
    }

    private ValueEnum(int value) {
        this.label = null;
        this.value = value;
    }

    public static ValueEnum get(int ordinal) {
        return new ValueEnum(null, ordinal);
    }

    public static ValueEnum get(String label, int ordinal) {
        return new ValueEnum(label, ordinal);
    }

    @Override
    public int getType() {
        return Value.ENUM;
    }

    @Override
    public Value add(Value v) {
        ValueEnum other = (ValueEnum) v;
        return checkRange(value + (long) other.value);
    }

    private static ValueEnum checkRange(long x) {
        if (x < Integer.MIN_VALUE || x > Integer.MAX_VALUE) {
            throw DbException.get(ErrorCode.NUMERIC_VALUE_OUT_OF_RANGE_1, Long.toString(x));
        }
        return ValueEnum.get((int) x);
    }

    @Override
    public int getSignum() {
        return Integer.signum(value);
    }

    @Override
    public Value negate() {
        return checkRange(-(long) value);
    }

    @Override
    public Value subtract(Value v) {
        ValueEnum other = (ValueEnum) v;
        return checkRange(value - (long) other.value);
    }

    @Override
    public Value multiply(Value v) {<FILL_FUNCTION_BODY>}

    @Override
    public Value divide(Value v) {
        ValueEnum other = (ValueEnum) v;
        if (other.value == 0) {
            throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL());
        }
        return ValueEnum.get(value / other.value);
    }

    @Override
    public Value modulus(Value v) {
        ValueEnum other = (ValueEnum) v;
        if (other.value == 0) {
            throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL());
        }
        return ValueEnum.get(value % other.value);
    }

    @Override
    public String getSQL() {
        return getString();
    }

    @Override
    public int getInt() {
        return value;
    }

    @Override
    public long getLong() {
        return value;
    }

    @Override
    protected int compareSecure(Value o, CompareMode mode) {
        ValueEnum v = (ValueEnum) o;
        if (label != null && v.label != null)
            return mode.compareString(label, v.label, false);
        return MathUtils.compareInt(value, v.value);
    }

    @Override
    public String getString() {
        return label;
    }

    @Override
    public long getPrecision() {
        return ValueInt.PRECISION;
    }

    @Override
    public int getDisplaySize() {
        return ValueInt.DISPLAY_SIZE;
    }

    @Override
    public int hashCode() {
        return value;
    }

    @Override
    public Object getObject() {
        return value;
    }

    @Override
    public void set(PreparedStatement prep, int parameterIndex) throws SQLException {
        prep.setInt(parameterIndex, value);
    }

    @Override
    public boolean equals(Object other) {
        return other instanceof ValueEnum && value == ((ValueEnum) other).value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }
}

        ValueEnum other = (ValueEnum) v;
        return checkRange(value * (long) other.value);
    
<methods>public non-sealed void <init>() ,public com.lealone.db.value.Value add(com.lealone.db.value.Value) ,public boolean checkPrecision(long) ,public static void clearCache() ,public void close() ,public int compareTo(com.lealone.db.value.Value) ,public final int compareTo(com.lealone.db.value.Value, com.lealone.db.value.CompareMode) ,public final int compareTypeSafe(com.lealone.db.value.Value, com.lealone.db.value.CompareMode) ,public com.lealone.db.value.Value convertPrecision(long, boolean) ,public com.lealone.db.value.Value convertScale(boolean, int) ,public com.lealone.db.value.Value convertTo(int) ,public com.lealone.db.value.Value divide(com.lealone.db.value.Value) ,public abstract boolean equals(java.lang.Object) ,public java.sql.Array getArray() ,public java.math.BigDecimal getBigDecimal() ,public java.sql.Blob getBlob() ,public boolean getBoolean() ,public byte getByte() ,public byte[] getBytes() ,public byte[] getBytesNoCopy() ,public java.sql.Clob getClob() ,public T getCollection() ,public java.sql.Date getDate() ,public abstract int getDisplaySize() ,public double getDouble() ,public float getFloat() ,public static int getHigherOrder(int, int) ,public java.io.InputStream getInputStream() ,public int getInt() ,public long getLong() ,public int getMemory() ,public abstract java.lang.Object getObject() ,public abstract long getPrecision() ,public java.io.Reader getReader() ,public java.sql.ResultSet getResultSet() ,public abstract java.lang.String getSQL() ,public int getScale() ,public short getShort() ,public int getSignum() ,public abstract java.lang.String getString() ,public java.sql.Time getTime() ,public java.sql.Timestamp getTimestamp() ,public java.lang.String getTraceSQL() ,public abstract int getType() ,public java.util.UUID getUuid() ,public abstract int hashCode() ,public final boolean isFalse() ,public com.lealone.db.value.Value modulus(com.lealone.db.value.Value) ,public com.lealone.db.value.Value multiply(com.lealone.db.value.Value) ,public com.lealone.db.value.Value negate() ,public abstract void set(java.sql.PreparedStatement, int) throws java.sql.SQLException,public com.lealone.db.value.Value subtract(com.lealone.db.value.Value) ,public java.lang.String toString() <variables>public static final int ARRAY,public static final int BLOB,public static final int BOOLEAN,public static final int BYTE,public static final int BYTES,public static final int CLOB,private static final com.lealone.db.value.CompareMode COMPARE_MODE,public static final int DATE,public static final int DECIMAL,public static final int DOUBLE,public static final int ENUM,public static final int FLOAT,public static final int INT,public static final int JAVA_OBJECT,public static final int LIST,public static final int LONG,public static final int MAP,private static final java.math.BigDecimal MAX_LONG_DECIMAL,private static final java.math.BigDecimal MIN_LONG_DECIMAL,public static final int NULL,public static final int RESULT_SET,public static final int SET,public static final int SHORT,public static final int STRING,public static final int STRING_FIXED,public static final int STRING_IGNORECASE,public static final int TIME,public static final int TIMESTAMP,public static final int TYPE_COUNT,public static final int UNKNOWN,public static final int UUID,private static SoftReference<com.lealone.db.value.Value[]> softCache