mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 21:29:00 +00:00

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.
34 lines
1.1 KiB
Java
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();
|
|
}
|