lab2
Class HashSet.ProtectedItr

java.lang.Object
  |
  +--lab2.HashSet.ProtectedItr
All Implemented Interfaces:
Iterator
Enclosing class:
HashSet

protected class HashSet.ProtectedItr
extends java.lang.Object
implements Iterator


Field Summary
protected  int expectedModCount
           
protected  Iterator listCursor
           
protected  int tableCursor
           
 
Constructor Summary
(package private) HashSet.ProtectedItr()
          Costruttore
 
Method Summary
 boolean hasNext()
          Indica se ci sono ulteriori oggetti da esaminare nell'iterazione corrente.
 java.lang.Object next()
          Restituisce l'oggetto successivo da esaminare nell'iterazione.
(package private)  void nextList()
           
 void remove()
          Cancella l'oggetto restituito dall'ultima chiamata al metodo next.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableCursor

protected int tableCursor

listCursor

protected Iterator listCursor

expectedModCount

protected int expectedModCount
Constructor Detail

HashSet.ProtectedItr

HashSet.ProtectedItr()
Costruttore
Method Detail

nextList

void nextList()

hasNext

public boolean hasNext()
Indica se ci sono ulteriori oggetti da esaminare nell'iterazione corrente.
Specified by:
hasNext in interface Iterator
Returns:
true se ci sono ulteriori oggetti; false altrimenti.
Throws:
ConcurrentModificationException - se avviene una modifica concorrente degli stessi oggetti mediante qualche altro metodo.

next

public java.lang.Object next()
Restituisce l'oggetto successivo da esaminare nell'iterazione.
Specified by:
next in interface Iterator
Returns:
il prossimo oggetto da esaminare.
Throws:
NoSuchElementException - se non ci sono altri oggetti da esaminare.
ConcurrentModificationException - se avviene una modifica concorrente degli stessi oggetti mediante qualche altro metodo.

remove

public void remove()
Cancella l'oggetto restituito dall'ultima chiamata al metodo next. Il metodo può essere invocato solo una volta per ciascuna chiamata a next.
Specified by:
remove in interface Iterator
Throws:
NoSuchElementException - se non ci sono altri oggetti da esaminare.
ConcurrentModificationException - se avviene una modifica concorrente degli stessi oggetti mediante qualche altro metodo.