MarginaliaSearch/code/libraries/array/java/nu/marginalia/array/LongArray.java
Viktor Lofgren 1d34224416 (refac) Remove src/main from all source code paths.
Look, this will make the git history look funny, but trimming unnecessary depth from the source tree is a very necessary sanity-preserving measure when dealing with a super-modularized codebase like this one.

While it makes the project configuration a bit less conventional, it will save you several clicks every time you jump between modules.  Which you'll do a lot, because it's *modul*ar.  The src/main/java convention makes a lot of sense for a non-modular project though.  This ain't that.
2024-02-23 16:13:40 +01:00

34 lines
1.1 KiB
Java

package nu.marginalia.array;
import nu.marginalia.array.algo.LongArrayBase;
import nu.marginalia.array.algo.LongArraySearch;
import nu.marginalia.array.algo.LongArraySort;
import nu.marginalia.array.algo.LongArrayTransformations;
import nu.marginalia.array.delegate.ShiftedLongArray;
import nu.marginalia.array.page.UnsafeLongArray;
import java.lang.foreign.Arena;
public interface LongArray extends LongArrayBase, LongArrayTransformations, LongArraySearch, LongArraySort, AutoCloseable {
int WORD_SIZE = 8;
@Deprecated
static LongArray allocate(long size) {
return UnsafeLongArray.onHeap(Arena.ofShared(), size);
}
default LongArray shifted(long offset) {
return new ShiftedLongArray(offset, this);
}
default LongArray range(long start, long end) {
return new ShiftedLongArray(start, end, this);
}
/** Translate the range into the equivalent range in the underlying array if they are in the same page */
ArrayRangeReference<LongArray> directRangeIfPossible(long start, long end);
void force();
void close();
}