mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Add missing forEach to TIterable
This commit is contained in:
parent
a9c4ab6aa4
commit
d18d50a823
|
@ -22,6 +22,12 @@ import org.teavm.classlib.java.util.TSpliterator;
|
|||
public interface TIterable<T> {
|
||||
TIterator<T> iterator();
|
||||
|
||||
default void forEach(Consumer<? super T> action) {
|
||||
for (TIterator<T> itr = iterator(); itr.hasNext();) {
|
||||
action.accept(itr.next());
|
||||
}
|
||||
}
|
||||
|
||||
default TSpliterator<T> spliterator() {
|
||||
TIterator<T> iterator = iterator();
|
||||
return new TSpliterator<T>() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user