|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fr.umlv.ji.figures.Figure.Collection
Collections of Figure
.
Collections of Figure
can contain any types of Figure
and can compute the sum of surfaces of the contained figures.
Collections also provide iterators for enumerating all their elements, or only elements of a given surface.
Collections can not be modified once they are built: figures can not be add or removed from a collection. Mutable figures can be modified without any consequence for the collections they belong to. A collection may contain duplicate elements.
Field Summary | |
private Figure[] |
figs
|
Constructor Summary | |
Figure.Collection(Figure[] f)
|
Method Summary | |
Iterator |
iterator()
Returns an iterator over all the elements in this set. |
Iterator |
search(double surface)
Returns an iterator over all the elements in this set whose area is equal to surface . |
double |
surface()
Returns the sum of all surfaces of figures in this set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Figure[] figs
Constructor Detail |
public Figure.Collection(Figure[] f)
Method Detail |
public double surface()
public Iterator iterator()
public Iterator search(double surface)
surface
. The elements are
returned in the same order as in the array given to the
constructor.
surface
- The surface of the figures the returned iterator
has to search for in this set.
surface
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |