de.bwaldvogel.liblinear.IntArrayPointer Maven / Gradle / Ivy
The newest version!
package de.bwaldvogel.liblinear;
final class IntArrayPointer {
private final int[] _array;
private int _offset;
void setOffset(int offset) {
if (offset < 0 || offset >= _array.length) throw new IllegalArgumentException("offset must be between 0 and the length of the array");
_offset = offset;
}
IntArrayPointer(final int[] array, final int offset) {
_array = array;
setOffset(offset);
}
public int get(final int index) {
return _array[_offset + index];
}
public void set(final int index, final int value) {
_array[_offset + index] = value;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy