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

org.reactfx.util.BiIndex Maven / Gradle / Ivy

There is a newer version: 2.0-M5
Show newest version
package org.reactfx.util;

import java.util.function.BiFunction;

public final class BiIndex {
    public final int major;
    public final int minor;

    public BiIndex(int major, int minor) {
        this.major = major;
        this.minor = minor;
    }

    public  T map(BiFunction f) {
        return f.apply(major, minor);
    }

    public BiIndex adjustMajor(int adjustment) {
        return new BiIndex(major + adjustment, minor);
    }

    public BiIndex adjustMinor(int adjustment) {
        return new BiIndex(major, minor + adjustment);
    }

    @Override
    public String toString() {
        return "[" + major + ", " + minor + "]";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy