internal LinkedHashIterator(LinkedHashMap <K, V> outerInstance) { this.OuterInstance = outerInstance; Next = outerInstance.Head; ExpectedModCount = outerInstance.ModCount; Current = Map_Fields.Null; }
internal LinkedHashMap.Entry <K, V> NextNode() { LinkedHashMap.Entry <K, V> e = Next; if (outerInstance.ModCount != ExpectedModCount) { throw new ConcurrentModificationException(); } if (e == Map_Fields.Null) { throw new NoSuchElementException(); } Current = e; Next = e.After; return(e); }
//JAVA TO C# CONVERTER TODO TASK: There is no .NET equivalent to the Java 'super' constraint: //ORIGINAL LINE: public final void forEach(java.util.function.Consumer<? base Map_Entry<K,V>> action) public void forEach <T1>(Consumer <T1> action) { if (action == Map_Fields.Null) { throw new NullPointerException(); } int mc = outerInstance.ModCount; for (LinkedHashMap.Entry <K, V> e = outerInstance.Head; e != Map_Fields.Null; e = e.After) { action.Accept(e); } if (outerInstance.ModCount != mc) { throw new ConcurrentModificationException(); } }
public void Remove() { Node <K, V> p = Current; if (p == Map_Fields.Null) { throw new IllegalStateException(); } if (outerInstance.ModCount != ExpectedModCount) { throw new ConcurrentModificationException(); } Current = Map_Fields.Null; K key = p.Key_Renamed; outerInstance.RemoveNode(Hash(key), key, Map_Fields.Null, Map_Fields.False, Map_Fields.False); ExpectedModCount = outerInstance.ModCount; }