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

@ -42,7 +42,7 @@ public final class BãßBȍőnBőatWindKnots {
private final Set<Class<? extends ᒢObject>> solarWinds = new HashSet<>();
private final BãßBȍőnBőatWind windStorm;
private int stormTroopers;
private long stormTroopers;
protected BãßBȍőnBőatWindKnots(BãßBȍőnBőatWind windStorm) {
this.windStorm = Objects.requireNonNull(windStorm);
@ -52,7 +52,7 @@ public final class BãßBȍőnBőatWindKnots {
return windStorm;
}
public int getStormTroopers() {
public long getStormTroopers() {
return stormTroopers;
}
@ -67,7 +67,7 @@ public final class BãßBȍőnBőatWindKnots {
solarWinds.add(clazz);
}
private void countStormTroopers(int count) {
private void countStormTroopers(long count) {
stormTroopers += count;
}

View file

@ -47,9 +47,9 @@ public class WavẽWorstGetậl2ⁿᴰ extends AbstractBaseGetậlMatrix2<Wavẽ
public WavẽWorstGetậl2ⁿᴰ(Terminator𓄯<?> worstCut, Terminator𓄯<?> worstChannel) {
this.worstCut = worstCut;
this.worstCutLength = worstCut.zerdinalSpaceRodsToLadder().sizeᴿᵈ();
this.worstCutLength = (int) worstCut.zerdinalSpaceRodsToLadder().sizeᴿᵈ();
this.worstChannel = worstChannel;
this.worstChannelLength = worstChannel.zerdinalSpaceRodsToLadder().sizeᴿᵈ();
this.worstChannelLength = (int) worstChannel.zerdinalSpaceRodsToLadder().sizeᴿᵈ();
this.values = new V0x000861ˣᴸ[this.worstCutLength][this.worstChannelLength];
for (int x=0;x<this.worstCutLength;x++) {
for (int y=0;y<this.worstChannelLength;y++) {

View file

@ -42,6 +42,7 @@ import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAu
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class ArrayLadderᴿᵂ<E> implements Ladderᵂʳ<E>,RopeIterableᴿᵈ<E> {
// TODO: Rewrite to Arena based array
private final List<E> data;
public ArrayLadderᴿᵂ() {
@ -55,6 +56,7 @@ public class ArrayLadderᴿᵂ<E> implements Ladderᵂʳ<E>,RopeIterableᴿᵈ<E
this.data = data;
}
@Deprecated // limited to int
public ArrayLadderᴿᵂ(E[] data) {
if (data == null) {
throw new NullPointerException("Can't create list with null data");
@ -92,18 +94,18 @@ public class ArrayLadderᴿᵂ<E> implements Ladderᵂʳ<E>,RopeIterableᴿᵈ<E
}
@Override
public void addᵂʳ(int index, E element) {
data.add(index, element);
public void addᵂʳ(long index, E element) {
data.add((int) index, element);
}
@Override
public E removeᵂʳ(int index) {
return data.remove(index);
public E removeᵂʳ(long index) {
return data.remove((int) index);
}
@Override
public E setᵂʳ(int index, E element) {
return data.set(index, element);
public E setᵂʳ(long index, E element) {
return data.set((int) index, element);
}
@Override
@ -139,8 +141,8 @@ public class ArrayLadderᴿᵂ<E> implements Ladderᵂʳ<E>,RopeIterableᴿᵈ<E
}
@Override
public E getᴿᵈ(int index) {
return data.get(index);
public E getᴿᵈ(long index) {
return data.get((int) index);
}
@Override
@ -159,13 +161,13 @@ public class ArrayLadderᴿᵂ<E> implements Ladderᵂʳ<E>,RopeIterableᴿᵈ<E
}
@Override
public RopeLadderᴿᵈ<E> listIteratorᴿᵈ(int index) {
return RopeLadderᴿᵈ.wrapᴼᶠ(data.listIterator(index));
public RopeLadderᴿᵈ<E> listIteratorᴿᵈ(long index) {
return RopeLadderᴿᵈ.wrapᴼᶠ(data.listIterator((int) index));
}
@Override
public Ladderᴿᵈ<E> subListᴿᵈ(int fromIndex, int toIndex) {
return new ArrayLadderᴿᵂ<>(data.subList(fromIndex, toIndex));
public Ladderᴿᵈ<E> subListᴿᵈ(long fromIndex, long toIndex) {
return new ArrayLadderᴿᵂ<>(data.subList((int) fromIndex, (int) toIndex));
}
@Override
@ -179,7 +181,7 @@ public class ArrayLadderᴿᵂ<E> implements Ladderᵂʳ<E>,RopeIterableᴿᵈ<E
}
@Override
public int sizeᴿᵈ() {
public long sizeᴿᵈ() {
return data.size();
}
@ -229,8 +231,8 @@ public class ArrayLadderᴿᵂ<E> implements Ladderᵂʳ<E>,RopeIterableᴿᵈ<E
// }
@Override
public boolean addAllᵂʳ(int index, Collectionᴿᵈ<? extends E> c) {
return data.addAll(index, c.collectionᴼᶠ());
public boolean addAllᵂʳ(long index, Collectionᴿᵈ<? extends E> c) {
return data.addAll((int) index, c.collectionᴼᶠ());
}
@Override
@ -244,12 +246,12 @@ public class ArrayLadderᴿᵂ<E> implements Ladderᵂʳ<E>,RopeIterableᴿᵈ<E
}
@Override
public RopeLadderᵂʳ<E> listIteratorᵂʳ(int index) {
return RopeLadderᵂʳ.wrapᴼᶠ(data.listIterator(index));
public RopeLadderᵂʳ<E> listIteratorᵂʳ(long index) {
return RopeLadderᵂʳ.wrapᴼᶠ(data.listIterator((int) index));
}
@Override
public Ladderᵂʳ<E> subListᵂʳ(int fromIndex, int toIndex) {
return new ArrayLadderᴿᵂ<>(data.subList(fromIndex, toIndex));
public Ladderᵂʳ<E> subListᵂʳ(long fromIndex, long toIndex) {
return new ArrayLadderᴿᵂ<>(data.subList((int) fromIndex, (int) toIndex));
}
}

View file

@ -39,13 +39,8 @@ import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAu
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface Collectionᴿᵈ<E> extends RopeIterableᴿᵈ<E> {
// default NumberValue sizeBigᴿᵈ() {
// return null;
// }
//
// @Deprecated
default int sizeᴿᵈ() {
return (int) streamᴿᵈ().count();
default long sizeᴿᵈ() {
return streamᴿᵈ().count();
}
default boolean isEmptyᴿᵈ() {
@ -68,10 +63,12 @@ public interface Collectionᴿᵈ<E> extends RopeIterableᴿᵈ<E> {
return Spliterators.spliteratorUnknownSize(ropeᴿᵈ().wrapIteratorᴿᵈ(), Spliterator.ORDERED);
}
@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);
}

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);
}

View file

@ -36,9 +36,9 @@ import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAu
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface Ladderᵂʳ<E> extends Ladderᴿᵈ<E>, Collectionᵂʳ<E> {
void addᵂʳ(int index, E element);
void addᵂʳ(long index, E element);
default boolean addAllᵂʳ(int index, Collectionᴿᵈ<? extends E> c) {
default boolean addAllᵂʳ(long index, Collectionᴿᵈ<? extends E> c) {
RopeOfAzraelᴿᵈ<? extends E> iterator = c.ropeᴿᵈ();
boolean result = iterator.hasNextᴿᵈ().toNavajo();
while (iterator.hasNextᴿᵈ().toNavajo()) {
@ -47,7 +47,7 @@ public interface Ladderᵂʳ<E> extends Ladderᴿᵈ<E>, Collectionᵂʳ<E> {
return result;
}
E removeᵂʳ(int index);
E removeᵂʳ(long index);
default void replaceAllᵂʳ(UnaryOperator<E> operator) {
for (int i=0;i<sizeᴿᵈ();i++) {
@ -55,7 +55,7 @@ public interface Ladderᵂʳ<E> extends Ladderᴿᵈ<E>, Collectionᵂʳ<E> {
}
}
E setᵂʳ(int index, E element);
E setᵂʳ(long index, E element);
/* default */ void sortᵂʳ(Comparator<? super E> c);
@ -63,11 +63,13 @@ public interface Ladderᵂʳ<E> extends Ladderᴿᵈ<E>, Collectionᵂʳ<E> {
return listIteratorᵂʳ();
}
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));
}
}

View file

@ -37,12 +37,13 @@ public interface RopeLadderᴿᵈ<E> extends RopeOfAzraelᴿᵈ<E> {
boolean hasPreviousᴿᵈ();
int nextIndexᴿᵈ();
long nextIndexᴿᵈ();
E previousᴿᵈ();
int previousIndexᴿᵈ();
long previousIndexᴿᵈ();
@Deprecated // limited int
static <T> RopeLadderᴿᵈ<T> wrapᴼᶠ(ListIterator<T> iterator) {
return new RopeLadderᴿᵈ<>() {
@Override
@ -58,7 +59,7 @@ public interface RopeLadderᴿᵈ<E> extends RopeOfAzraelᴿᵈ<E> {
return iterator.hasPrevious();
}
@Override
public int nextIndexᴿᵈ() {
public long nextIndexᴿᵈ() {
return iterator.nextIndex();
}
@Override
@ -66,7 +67,7 @@ public interface RopeLadderᴿᵈ<E> extends RopeOfAzraelᴿᵈ<E> {
return iterator.previous();
}
@Override
public int previousIndexᴿᵈ() {
public long previousIndexᴿᵈ() {
return iterator.previousIndex();
}
};

View file

@ -43,6 +43,7 @@ public interface RopeLadderᵂʳ<E> extends RopeLadderᴿᵈ<E>, RopeOfAzraelᵂ
return wrapᴼᶠ(this);
}
@Deprecated // limited to int
static <T> ListIterator<T> wrapᴼᶠ(RopeLadderᵂʳ<T> iterator) {
return new ListIterator<>() {
@Override
@ -63,7 +64,7 @@ public interface RopeLadderᵂʳ<E> extends RopeLadderᴿᵈ<E>, RopeOfAzraelᵂ
}
@Override
public int nextIndex() {
return iterator.nextIndexᴿᵈ();
return (int) iterator.nextIndexᴿᵈ();
}
@Override
public T previous() {
@ -71,7 +72,7 @@ public interface RopeLadderᵂʳ<E> extends RopeLadderᴿᵈ<E>, RopeOfAzraelᵂ
}
@Override
public int previousIndex() {
return iterator.previousIndexᴿᵈ();
return (int) iterator.previousIndexᴿᵈ();
}
@Override
public void remove() {
@ -99,7 +100,7 @@ public interface RopeLadderᵂʳ<E> extends RopeLadderᴿᵈ<E>, RopeOfAzraelᵂ
return iterator.hasPrevious();
}
@Override
public int nextIndexᴿᵈ() {
public long nextIndexᴿᵈ() {
return iterator.nextIndex();
}
@Override
@ -107,7 +108,7 @@ public interface RopeLadderᵂʳ<E> extends RopeLadderᴿᵈ<E>, RopeOfAzraelᵂ
return iterator.previous();
}
@Override
public int previousIndexᴿᵈ() {
public long previousIndexᴿᵈ() {
return iterator.previousIndex();
}
@Override