Added forEach(CONSUMER, Input)

This commit is contained in:
2026-08-09 21:43:57 +02:00
parent 075f3ad183
commit 2306917b10
29 changed files with 2462 additions and 1842 deletions
@@ -33,6 +33,9 @@ import speiger.src.collections.PACKAGE.functions.OPTIONAL;
#endif
import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
#if !TYPE_OBJECT
import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
#endif
#if !JDK_FUNCTION
import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
#endif
@@ -425,6 +428,13 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
action.accept(input, entry.key);
}
@Override
public <E> void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE<E> action, E input) {
Objects.requireNonNull(action);
for(Entry KEY_GENERIC_TYPE entry = first;entry != null;entry = entry.next())
action.accept(entry.key, input);
}
@Override
public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
Objects.requireNonNull(filter);
@@ -1311,6 +1321,13 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
action.accept(input, entry.key);
}
@Override
public <E> void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE<E> action, E input) {
Objects.requireNonNull(action);
for(Entry KEY_GENERIC_TYPE entry = start();entry != null && inRange(entry.key);entry = next(entry))
action.accept(entry.key, input);
}
@Override
public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
Objects.requireNonNull(filter);