Message-ID: <1377342219.6439.1394570126158.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_6438_2116133398.1394570126157" ------=_Part_6438_2116133398.1394570126157 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The Iterator Pattern allows sequenti= al access to the elements of an aggregate object without exposing its under= lying representation.=20
Groovy has the iterator pattern built right in to many of its closur=
e operators, e.g.
eachWithIndex as =
well as the
for .. in loop.
For example:=20 =20
Results in the output:=20 =20
Another example:=20 =20
Results in:=20 =20
The iterator pattern is also built in to other special operators such as=
ors for working with streams, URLs, files, directories and regular expressi=