org.reactfx.util.BiIndex Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of reactfx Show documentation
Show all versions of reactfx Show documentation
Reactive event streams for JavaFX
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 + "]";
}
}