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

com.fillumina.performance.util.interval.DecimalInterval Maven / Gradle / Ivy

Go to download

Configurable tool to easily compare performances of different code snippets and to take performance telemetry of a running application.

The newest version!
package com.fillumina.performance.util.interval;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 *
 * @author Francesco Illuminati
 */
public class DecimalInterval
        extends AbstractBuildableInterval
        implements BuildableInterval, Serializable {
    private static final long serialVersionUID = 1L;

    public static IntervalBuilder cycle() {
        return new IntervalBuilder<>(
                new DecimalInterval());
    }

    private DecimalInterval() {}

    @Override
    protected boolean isLessThan(final BigDecimal smaller, final BigDecimal bigger) {
        return smaller.compareTo(bigger) == -1;
    }

    @Override
    protected BigDecimal calculateCurrent(final BigDecimal first,
            final BigDecimal step, final int index) {
        return first.add(step.multiply(BigDecimal.valueOf(index)));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy