uoc.ei.tads
Class ArbreGeneralDelegImpl.RecorregutFills<E>

java.lang.Object
  extended by uoc.ei.tads.ArbreGeneralDelegImpl.RecorregutFills<E>
All Implemented Interfaces:
java.io.Serializable, Recorregut<E>
Enclosing class:
ArbreGeneralDelegImpl<E>

protected static class ArbreGeneralDelegImpl.RecorregutFills<E>
extends java.lang.Object
implements Recorregut<E>

Classe que proporciona un recorregut de les posicions. Basada en el pattern Iterator, soporta múltiples recorreguts simultanis i independents del contenidor. És sensible a eventuals alteracions de l'estructura de posicions.

See Also:
Recorregut.hiHaSeguent(), Recorregut.seguent(), Serialized Form

Field Summary
protected  ArbreGeneralDelegImpl<E> arbre
          Arbre que s'està recorrent.
protected  Posicio<E> fill
          Posició auxiliar.
 
Constructor Summary
ArbreGeneralDelegImpl.RecorregutFills(ArbreGeneralDelegImpl<E> arbre, Posicio<E> pare)
          Constructor amb un paràmetre.
 
Method Summary
 boolean hiHaSeguent()
          Comprova si hi ha una primera o següent posició.
 Posicio<E> seguent()
          Primer avança, si es pot, i després retorna la posició.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arbre

protected ArbreGeneralDelegImpl<E> arbre
Arbre que s'està recorrent.


fill

protected Posicio<E> fill
Posició auxiliar.

Constructor Detail

ArbreGeneralDelegImpl.RecorregutFills

public ArbreGeneralDelegImpl.RecorregutFills(ArbreGeneralDelegImpl<E> arbre,
                                             Posicio<E> pare)
Constructor amb un paràmetre.

Parameters:
pare - posicio de referència; s'espera que sigui una posició vàlida
Method Detail

hiHaSeguent

public boolean hiHaSeguent()
Comprova si hi ha una primera o següent posició. És sensible a eventuals alteracions de l'estructura de posicions. Retorna fals si està buit o ja s'ha visitat l'última posició.

Specified by:
hiHaSeguent in interface Recorregut<E>
Returns:
cert o fals, segons si es pot avançar o no es pot

seguent

public Posicio<E> seguent()
                   throws ExcepcioPosicioInvalida
Primer avança, si es pot, i després retorna la posició. Si no hi ha següent posició llança una excepció.

Specified by:
seguent in interface Recorregut<E>
Returns:
següent posició
Throws:
ExcepcioPosicioInvalida - si es vol obtenir el següent element de l'enumeració i no n'hi ha cap o no n'hi ha cap més