All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dominokit.domino.ui.forms.DoubleBox Maven / Gradle / Ivy

There is a newer version: 1.0.139
Show newest version
package org.dominokit.domino.ui.forms;

import org.dominokit.domino.ui.utils.ElementUtil;

public class DoubleBox extends NumberBox {

    public static DoubleBox create() {
        return new DoubleBox();
    }

    public static DoubleBox create(String label) {
        return new DoubleBox(label);
    }

    public DoubleBox() {
        this("");
    }

    public DoubleBox(String label) {
        super(label);
        ElementUtil.decimalOnly(this);
    }

    @Override
    protected void clearValue() {
        value(0.0);
    }

    @Override
    protected Double parseValue(String value) {
        return getNumberFormat().parse(value);
    }

    @Override
    protected boolean isExceedMaxValue(Double maxValue, Double value) {
        return value.compareTo(maxValue) > 0;
    }

    @Override
    protected boolean isLowerThanMinValue(Double minValue, Double value) {
        return value.compareTo(minValue) < 0;
    }

    @Override
    protected Double defaultMaxValue() {
        return Double.MAX_VALUE;
    }

    @Override
    protected Double defaultMinValue() {
        return Double.NEGATIVE_INFINITY;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy