@Deprecated public class XMLListIterator extends Object implements XMLListIteratorInterface
XMLListIterator implementa um iterador sobre uma lista
de elementos do tipo XMLElementInterface, retornando a cada iteração o
próximo elemento cuja tag é igual à tag especificada no construtor (ou null
caso não existam mais elementos com esta tag). Esta implementação assume que
os objetos são adjacentes na lista.| Modifier and Type | Field and Description |
|---|---|
static String |
ANY
Deprecated.
Tag usada para iterar sobre qualquer elemento
|
| Constructor and Description |
|---|
XMLListIterator(List<XMLElementInterface> list)
Deprecated.
Constrói um iterador sobre qualquer elemento (tag de referência "ANY").
|
XMLListIterator(List<XMLElementInterface> list,
String tag)
Deprecated.
Constrói um iterador sobre uma lista, buscando por uma tag específica.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getTag()
Deprecated.
Retorna a tag de referência para o iterador (o valor que será usado na
comparação com os elementos da lista).
|
boolean |
hasNext()
Deprecated.
Indica se existe mais algum elemento na lista cuja tag seja igual à
solicitada.
|
XMLElementInterface |
next()
Deprecated.
Retorna o próximo elemento com tipo igual ao que vínhamos buscando ou null
caso não haja mais elementos deste tipo.
|
XMLElementInterface |
next(String _tag)
Deprecated.
Obtém o próximo elemento da lista que possui a tag desejada, ou null caso
não haja mais elementos com esta tag.
Se a tag solicitada é a mesma que vínhamos buscando, simplesmente continuamos a iteração. |
void |
reset()
Deprecated.
Reinicializa o iterador, usando a tag ANY como tag de busca.
|
void |
reset(String _tag)
Deprecated.
Reinicializa o iterador, redefinindo a tag de busca.
|
public static final String ANY
public XMLListIterator(List<XMLElementInterface> list, String tag)
list - lista de elementostag - tag a ser buscadaIllegalArgumentException - se a lista é nullpublic XMLListIterator(List<XMLElementInterface> list)
list - lista de elementospublic void reset(String _tag)
reset in interface XMLListIteratorInterface_tag - nova tag de buscapublic void reset()
reset in interface XMLListIteratorInterfacepublic XMLElementInterface next()
next in interface XMLListIteratorInterfacepublic XMLElementInterface next(String _tag)
next in interface XMLListIteratorInterface_tag - nova tag de buscapublic boolean hasNext()
hasNext in interface XMLListIteratorInterfacetrue se o elemento seguinte na lista possui tag
igual à tag de busca, false caso contrário.public String getTag()
getTag in interface XMLListIteratorInterfaceCopyright © 2016 Tecgraf/PUC-Rio. All rights reserved.