Re: Can we loop on an Map in the TDD?
Daniel Dekany <[email protected]> Wed, 19 Jul 2006 10:56:30 +0200
| Newsgroups | gmane.comp.text.fmpp |
|---|---|
| Message-ID | <[email protected]> |
--===============0578437631==
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-=
1">
<meta http-equiv=3D"Content-Style-Type" content=3D"text/css">
<style type=3D"text/css"><!--
body {
margin: 5px 5px 5px 5px;
background-color: #ffffff;
}
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Text Styles =3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D */
hr { color: #000000}
body, table /* Normal text */
{
font-size: 9pt;
font-family: 'Courier New';
font-style: normal;
font-weight: normal;
color: #000000;
text-decoration: none;
}
span.rvts1 /* Heading */
{
font-size: 10pt;
font-family: 'Arial';
font-weight: bold;
color: #0000ff;
}
span.rvts2 /* Subheading */
{
font-size: 10pt;
font-family: 'Arial';
font-weight: bold;
color: #000080;
}
span.rvts3 /* Keywords */
{
font-size: 10pt;
font-family: 'Arial';
font-style: italic;
color: #800000;
}
a.rvts4, span.rvts4 /* Jump 1 */
{
font-size: 10pt;
font-family: 'Arial';
color: #008000;
text-decoration: underline;
}
a.rvts5, span.rvts5 /* Jump 2 */
{
font-size: 10pt;
font-family: 'Arial';
color: #008000;
text-decoration: underline;
}
span.rvts6
{
font-size: 11pt;
font-family: 'tahoma';
font-weight: bold;
color: #ffffff;
}
span.rvts7
{
font-size: 11pt;
font-family: 'arial';
}
span.rvts8
{
font-size: 11pt;
font-family: 'tahoma';
}
span.rvts9
{
font-size: 8pt;
font-family: 'arial';
font-style: italic;
color: #c0c0c0;
}
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Para Styles =3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D */
p,ul,ol /* Paragraph Style */
{
text-align: left;
text-indent: 0px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
text-align: center;
}
--></style>
</head>
<body>
<p>Wednesday, July 19, 2006, 8:10:41 AM, Colbert Philippe wrote:</p>
<p><br></p>
<div><table border=3D0 cellpadding=3D1 cellspacing=3D2 style=3D"border-co=
lor: #000000; border-style: solid; background-color: #ffffff;">
<tr valign=3Dtop>
<td width=3D14 style=3D"background-color: #0000ff;">
<p><span class=3Drvts6>></span></p>
</td>
<td width=3D547>
<p><span class=3Drvts7>We know that we can loop on List in the TDD file (=
i..e someList : [ ...items...]) using the <#list ....> command. &nb=
sp;</span></p>
<p><span class=3Drvts8> </span></p>
<p><span class=3Drvts7>Can we loop on Map in the TDD file in the order it=
appears in the TDD file? There is a strong need for this. =
Looping through entries of a map, we could get access to the key and valu=
e of each entry (i.e. entry.key and entry.value)?</span></p>
<p><span class=3Drvts8> </span></p>
<p><span class=3Drvts7>Java allows for looping through Map but the order =
is not respected. I don't know if such Map exists. The progr=
ammer might have to code a Map as a List<Entry> in order to achieve=
this.</span></p>
</td>
</tr>
</table>
</div>
<p><br></p>
<p>Listing maps is possible using the myMap?keys or myMap?values in FreeM=
arker, however, as you said, it doesn't keep the order as the entires wer=
e added. It could be fixed by replacing HashMap with LinkedHashMap in the=
TDD implementation. The problem is that LinkedHashMap was added in J2SE =
1.4 only (incredible, isn't it?)... So if I use that, maps will not be or=
dered if you use J2SE 1.3 or 1.2, and that's confusing. Or FMPP has to re=
quire at least J2SE 1.4. Or do somebody know about a J2SE 1.2 compatible =
free LinkedHashMap implementation that extends HashMap? I haven't found a=
ny...</p>
<p><br></p>
<p><span class=3Drvts9>-- </span></p>
<p><span class=3Drvts9>Best regards,</span></p>
<p><span class=3Drvts9> Daniel Dekany</span></p>
</body></html>
--===============0578437631==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--===============0578437631==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
fmpp-open mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fmpp-open
--===============0578437631==--