|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectProjecto.RectIntersectIterator
public class RectIntersectIterator
Classe que implementa a interface Iterator. A sua função é iterar sobre as figuras do mesmo tipo. Docente: Hugo Vieira P3
| Constructor Summary | |
|---|---|
RectIntersectIterator(Geometric_Figure[] figures,
int counter,
double xUpperLeft,
double yUpperLeft,
double xLowerRight,
double yLowerRight)
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 RectIntersectIterator(Geometric_Figure[] figures,
int counter,
double xUpperLeft,
double yUpperLeft,
double xLowerRight,
double yLowerRight)
figures - - vector de figurar sobre o qual vai ser feita a iteração.counter - - número de figuras existentes no vector.xUpperLeft - - Coordenada X do ponto superior esquerdo do rectângulo envolvente.yUpperLeft - - Coordenada Y do ponto superior esquerdo do rectângulo envolvente.xLowerRight - - Coordenada X do ponto inferior direito do rectângulo envolvente.yLowerRight - - Coordenada Y do ponto inferior direito do rectângulo envolvente.| 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 | ||||||||