Java intrebare. Iterator + LinkedHashMap
public abstract class ScopeEntry extends Entry { private LinkedHashMap localSymtab = new LinkedHashMap(5); private Iterator iterator; /** Resets the iteration to the beginning, i.e., to the first element * in the iteration. */ public void first() { this.iterator=this.localSymtab.keySet().iterator(); } /** Returns the current element and advances the iteration. */ public Entry next() { if(this.hasMore()) return (Entry)this.iterator.next(); else return null; } /** Returns whether or not there are more elements to be iterated. */ public boolean hasMore() { return this.iterator.hasNext(); } }Amu intrebarea - cum de implementat metoda first()?Mie imi trebuie un iterator, cu care sa pot itera prin LinkedHashMap (randu de mai sus itereaza prin KeySet()).Ulterior o sa am nevoie sa mai chem aceasta metoda, si dupa ce au fost chemate metodele iterator.next(); cum pot sa intorc iterator sa imi dea referinta spre primul element din lista data?