org.dflib.range.Range Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dflib Show documentation
Show all versions of dflib Show documentation
dflib: DataFrame library
package org.dflib.range;
/**
* @since 0.6
*/
public class Range {
public static void checkRange(int from, int len, int masterLen) {
if (from < 0) {
throw new IllegalArgumentException("Negative 'from' index: " + from);
}
if (len < 0) {
throw new IllegalArgumentException("Negative 'len': " + len);
}
if (from > masterLen) {
throw new IllegalArgumentException("From is out of range: " + from + " (" + masterLen + ")");
}
if (from + len > masterLen) {
throw new IllegalArgumentException("Length is out of range: (" + (from + len) + " > " + masterLen + ")");
}
}
}