JPP: Basic collections2 api to long conversion

This commit is contained in:
Willem Cazander 2026-02-01 17:54:22 +01:00
parent 8f2b368795
commit b8bac0c19b
8 changed files with 59 additions and 52 deletions

View file

@ -34,7 +34,7 @@ import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAu
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface Ladderᴿᵈ<E> extends Collectionᴿᵈ<E> {
default E getᴿᵈ(int index) {
default E getᴿᵈ(long index) {
return streamᴿᵈ().skip(index).collect(Collectors.toList()).get(0);
}
@ -50,18 +50,22 @@ public interface Ladderᴿᵈ<E> extends Collectionᴿᵈ<E> {
return listIteratorᴿᵈ(0);
}
default RopeLadderᴿᵈ<E> listIteratorᴿᵈ(int index) {
return RopeLadderᴿᵈ.wrapᴼᶠ(streamᴿᵈ().collect(Collectors.toList()).listIterator(index));
default RopeLadderᴿᵈ<E> listIteratorᴿᵈ(long index) {
// TODO: fix cast
return RopeLadderᴿᵈ.wrapᴼᶠ(streamᴿᵈ().collect(Collectors.toList()).listIterator((int) index));
}
default Ladderᴿᵈ<E> subListᴿᵈ(int fromIndex, int toIndex) {
return new ArrayLadderᴿᵂ<>(streamᴿᵈ().collect(Collectors.toList()).subList(fromIndex, toIndex));
default Ladderᴿᵈ<E> subListᴿᵈ(long fromIndex, long toIndex) {
// TODO: fix cast
return new ArrayLadderᴿᵂ<>(streamᴿᵈ().collect(Collectors.toList()).subList((int) fromIndex,(int) toIndex));
}
@Deprecated // limited to int size
default Object[] toArrayᴿᵈ() {
return streamᴿᵈ().collect(Collectors.toList()).toArray();
}
@Deprecated // limited to int size
default <T> T[] toArrayᴿᵈ(T[] arr) {
return streamᴿᵈ().collect(Collectors.toList()).toArray(arr);
}