Added full wrap of List

This commit is contained in:
Willem Cazander 2022-10-24 16:49:37 +02:00
parent 9fca87d677
commit bb0c0c937a
7 changed files with 169 additions and 8 deletions

View file

@ -59,7 +59,7 @@ public class DemoNumberMatrixDeskApp extends AbstractDeskApp implements DeskAppR
}
ImGui.tableHeadersRow();
for (BãßBȍőnNumberMatrixʸᴰ<?> part:numberMatrix.waardes().iterable()) {
for (BãßBȍőnNumberMatrixʸᴰ<?> part:numberMatrix.waardes().iterableᴼᶠ()) {
ImGui.tableNextRow();
ImGui.tableNextColumn();

View file

@ -22,7 +22,7 @@ public class GDXAppDesktopLauncher {
GDXAppDesktopConfig.printBootMessage();
List<String> args = Arrays.asList(arg);
if (args.contains(GDXAppDesktopConfig.SINGLE_THREAD_JVM)) {
GDXAppDesktopConfig.LOG.info("Bãß.характеристики.cpu=SINGLE_THREAD_JVM)");
GDXAppDesktopConfig.LOG.info("Bãß.характеристики.cpu=SINGLE_THREAD_JVM");
Bãß.характеристики.熱蘭遮城.ױזךיךזװןיןיןןזױז();
}

View file

@ -4,6 +4,11 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Spliterator;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.function.UnaryOperator;
import java.util.stream.Stream;
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
@ -23,11 +28,15 @@ public class ArrayListᴿᵂ<E> implements Listᵂʳ<E>,Iterable<E> {
this.data = data;
}
// ---- Iterable
@Override
public Iterator<E> iterator() {
return data.iterator();
}
// ---- Listᵂʳ
@Override
public Iteratorᴿᵈ<E> iteratorᴿᵈ() {
return Iteratorᴿᵈ.wrapᴼᶠ(iterator());
@ -64,7 +73,149 @@ public class ArrayListᴿᵂ<E> implements Listᵂʳ<E>,Iterable<E> {
}
@Override
public void sortᵂʳ(Comparator<? super E> c) {
public void sortᵂʳ(Comparator<? super E> c) { // TODO: add default impl
data.sort(c);
}
// ---- Optional, but for speed
@Override
public void forEachᴿᵈ(Consumer<? super E> action) {
data.forEach(action);
}
@Override
public void clearᵂʳ() {
data.clear();
}
@Override
public boolean removeAllᵂʳ(Collectionᴿᵈ<?> set) {
return data.removeAll(set.collectionᴼᶠ());
}
@Override
public boolean removeIfᵂʳ(Predicate<? super E> filter) {
return data.removeIf(filter);
}
@Override
public boolean retainAllᵂʳ(Collectionᴿᵈ<?> set) {
return data.retainAll(set.collectionᴼᶠ());
}
@Override
public E getᴿᵈ(int index) {
return data.get(index);
}
@Override
public int indexOfᴿᵈ(Object o) {
return data.indexOf(o);
}
@Override
public int lastIndexOfᴿᵈ(Object o) {
return data.lastIndexOf(o);
}
@Override
public ListIteratorᴿᵈ<E> listIteratorᴿᵈ() {
return ListIteratorᴿᵈ.wrapᴼᶠ(data.listIterator());
}
@Override
public ListIteratorᴿᵈ<E> listIteratorᴿᵈ(int index) {
return ListIteratorᴿᵈ.wrapᴼᶠ(data.listIterator(index));
}
@Override
public Listᴿᵈ<E> subListᴿᵈ(int fromIndex, int toIndex) {
return new ArrayListᴿᵂ<>(data.subList(fromIndex, toIndex));
}
@Override
public Object[] toArrayᴿᵈ() {
return data.toArray();
}
@Override
public <T> T[] toArrayᴿᵈ(T[] arr) {
return data.toArray(arr);
}
@Override
public int sizeᴿᵈ() {
return data.size();
}
@Override
public boolean isEmptyᴿᵈ() {
return data.isEmpty();
}
@Override
public boolean containsᴿᵈ(Object obj) {
return data.contains(obj);
}
@Override
public boolean containsAllᴿᵈ(Collectionᴿᵈ<?> set) {
return data.containsAll(set.collectionᴼᶠ());
}
@Override
public Stream<E> parallelStreamᴿᵈ() {
return data.parallelStream();
}
@Override
public Spliterator<E> spliteratorᴿᵈ() {
return data.spliterator();
}
@Override
public Stream<E> streamᴿᵈ() {
return data.stream();
}
@Override
public boolean addAllᵂʳ(Collectionᴿᵈ<? extends E> c) {
return data.addAll(c.collectionᴼᶠ());
}
@Override
public void forEach(Consumer<? super E> action) {
data.forEach(action);
}
@Override
public Spliterator<E> spliterator() {
return data.spliterator();
}
@Override
public boolean addAllᵂʳ(int index, Collectionᴿᵈ<? extends E> c) {
return data.addAll(index, c.collectionᴼᶠ());
}
@Override
public void replaceAllᵂʳ(UnaryOperator<E> operator) {
data.replaceAll(operator);
}
@Override
public ListIteratorᵂʳ<E> listIteratorᵂʳ() {
return ListIteratorᵂʳ.wrapᴼᶠ(data.listIterator());
}
@Override
public ListIteratorᵂʳ<E> listIteratorᵂʳ(int index) {
return ListIteratorᵂʳ.wrapᴼᶠ(data.listIterator(index));
}
@Override
public Listᵂʳ<E> subListᵂʳ(int fromIndex, int toIndex) {
return new ArrayListᴿᵂ<>(data.subList(fromIndex, toIndex));
}
}

View file

@ -1,5 +1,6 @@
package love.distributedrebirth.bassboon.jpp.util;
import java.util.Collection;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.stream.Collectors;
@ -11,6 +12,11 @@ import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface Collectionᴿᵈ<E> extends Iterableᴿᵈ<E> {
// default NumberValue sizeBigᴿᵈ() {
// return null;
// }
//
// @Deprecated
default int sizeᴿᵈ() {
return (int) streamᴿᵈ().count();
}
@ -46,4 +52,8 @@ public interface Collectionᴿᵈ<E> extends Iterableᴿᵈ<E> {
default Stream<E> streamᴿᵈ() {
return StreamSupport.stream(spliteratorᴿᵈ(), false);
}
default Collection<E> collectionᴼᶠ() {
return streamᴿᵈ().collect(Collectors.toList());
}
}

View file

@ -16,7 +16,7 @@ public interface Collectionᵂʳ<E> extends Collectionᴿᵈ<E>, Appenderᵂʳ<E
streamᴿᵈ().collect(Collectors.toList()).forEach(v -> removeᵂʳ(v));
}
default boolean removeAll(Collectionᴿᵈ<?> set) {
default boolean removeAllᵂʳ(Collectionᴿᵈ<?> set) {
boolean result = false;
Iteratorᴿᵈ<?> iterator = set.iteratorᴿᵈ();
while (iterator.hasNextᴿᵈ()) {
@ -27,7 +27,7 @@ public interface Collectionᵂʳ<E> extends Collectionᴿᵈ<E>, Appenderᵂʳ<E
return result;
}
default boolean removeIf(Predicate<? super E> filter) {
default boolean removeIfᵂʳ(Predicate<? super E> filter) {
boolean result = false;
Iteratorᵂʳ<E> iterator = iteratorᵂʳ();
while (iterator.hasNextᴿᵈ()) {
@ -39,7 +39,7 @@ public interface Collectionᵂʳ<E> extends Collectionᴿᵈ<E>, Appenderᵂʳ<E
return result;
}
default boolean retainAll(Collectionᴿᵈ<?> set) {
default boolean retainAllᵂʳ(Collectionᴿᵈ<?> set) {
boolean result = false;
for (E e:streamᴿᵈ().collect(Collectors.toList())) {
if (!set.containsᴿᵈ(e)) {

View file

@ -20,7 +20,7 @@ public interface Iterableᴿᵈ<E> {
return Spliterators.spliteratorUnknownSize(iteratorᴿᵈ().iteratorᴼᶠ(), Spliterator.ORDERED);
}
default Iterable<E> iterable() {
default Iterable<E> iterableᴼᶠ() {
return new Iterable<>() {
@Override
public Iterator<E> iterator() {

View file

@ -105,7 +105,7 @@ public class NumberXDModuleLoader implements X4OLanguageModuleLoader {
}
private void configBãßBȍőnPartAttributes(X4OLanguage language,ElementClass ec, BãßBȍőnPartʸᴰ<?> basePart) throws X4OLanguageModuleLoaderException {
for (BãßBȍőnPartʸᴰ<?> part: basePart.teŀráàmWaardes().iterable()) {
for (BãßBȍőnPartʸᴰ<?> part: basePart.teŀráàmWaardes().iterableᴼᶠ()) {
ec.addElementClassAttribute(createElementClassAttribute(language,part.rȧñkChinaSleutel(),true,new BãßBȍőnPartDialToneConverter(part)));
}
}