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

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

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

Classe que proporciona un recorregut de les posicions filles. 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

Constructor Summary
ArbreBinari.RecorregutFills(ArbreBinari<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
 

Constructor Detail

ArbreBinari.RecorregutFills

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

Parameters:
pare - posició no null de referència
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 és fulla 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