Browse Source

forEach-Methode implementiert

T_SS19_Map
hertero 3 years ago
parent
commit
8c6c3ded0f
  1. 8
      SimpleArrayMap/src/solution/SimpleArrayMap.java

8
SimpleArrayMap/src/solution/SimpleArrayMap.java

@ -102,8 +102,12 @@ public class SimpleArrayMap<K, V> implements ISimpleMap<K, V> {
@Override
public void forEach(Consumer<? super V> consumer) {
// TODO Auto-generated method stub
for (int i = 0; i < values.length; i++) {
if (keys[i] != null) {
consumer.accept(values[i]);
}
}
}
@Override

Loading…
Cancel
Save