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

org.jgroups.stack.ExponentialInterval Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.jgroups.stack;

/**
 * @author Bela Ban
 */
public class ExponentialInterval implements Interval {
    private int value=30;
    private static final int MAX=15000;

    public ExponentialInterval() {
        
    }

    public ExponentialInterval(int value) {
        this.value=value;
    }

    public long next() {
        long retval=value;
        value=Math.min(MAX, value * 2);
        return retval;
    }

    /** We don't need to copy as we don't have any state */
    public final Interval copy() {
        return new ExponentialInterval(value);
    }

    public String toString() {
        return String.valueOf(value);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy