public final Map.Entry<K,V> next() { Node<K,V> p; if ((p = next) == null) throw new NoSuchElementException(); K k = p.key; V v = p.val; lastReturned = p; advance(); return new MapEntry<K,V>(k, v, map); } }
public boolean tryAdvance(Action<? super Map.Entry<K,V>> action) { if (action == null) throw new NullPointerException(); Node<K,V> p; if ((p = advance()) == null) return false; action.apply(new MapEntry<K,V>(p.key, p.val, map)); return true; }
public void forEachRemaining(Action<? super Map.Entry<K,V>> action) { if (action == null) throw new NullPointerException(); for (Node<K,V> p; (p = advance()) != null; ) action.apply(new MapEntry<K,V>(p.key, p.val, map)); }
public void forEach(Action<? super Map.Entry<K,V>> action) { if (action == null) throw new NullPointerException(); Node<K,V>[] t; if ((t = map.table) != null) { Traverser<K,V> it = new Traverser<K,V>(t, t.length, 0, t.length); for (Node<K,V> p; (p = it.advance()) != null; ) action.apply(new MapEntry<K,V>(p.key, p.val, map)); } }