|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectProjecto.TypeIterator
public class TypeIterator
Classe que implementa a interface Iterator. A sua função é iterar sobre as figuras do mesmo tipo. Docente: Hugo Vieira P3
| Constructor Summary | |
|---|---|
TypeIterator(java.lang.String type,
Geometric_Figure[] figures,
int counter)
Construtor do iterador. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
Verifica se existe mais algum elemento a visitar |
void |
init()
Vai para o início da colecção |
Geometric_Figure |
next()
Devolve o próximo elemento a visitar na colecção. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TypeIterator(java.lang.String type,
Geometric_Figure[] figures,
int counter)
type - - tipo das figuras a iterar.figures - - vector de figurar sobre o qual vai ser feita a iteração.counter - - número de figuras existentes no vector.| Method Detail |
|---|
public void init()
Iterator
init in interface Iteratorpublic boolean hasNext()
Iterator
hasNext in interface Iteratortrue, se houver mais elementos a visitar, false, caso contráriopublic Geometric_Figure next()
Iterator
next in interface Iterator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||