tfw.immutable.ila.longila.LongIlaFill Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tfw Show documentation
Show all versions of tfw Show documentation
The FrameWork for building highly scalable and maintainable applications
The newest version!
package tfw.immutable.ila.longila;
import tfw.check.Argument;
public final class LongIlaFill {
private LongIlaFill() {
// non-instantiable class
}
public static LongIla create(long value, long length) {
Argument.assertNotLessThan(length, 0, "length");
return new LongIlaImpl(value, length);
}
private static class LongIlaImpl extends AbstractLongIla {
private final long value;
private final long length;
private LongIlaImpl(long value, long length) {
this.value = value;
this.length = length;
}
@Override
protected long lengthImpl() {
return length;
}
@Override
protected void getImpl(long[] array, int offset, long start, int length) {
final int startPlusLength = (int) (start + length);
for (int startInt = (int) start; startInt != startPlusLength; ++startInt, offset++) {
array[offset] = value;
}
}
}
}
// AUTO GENERATED FROM TEMPLATE