rwaldhoff 2003/11/17 13:00:44 Modified: primitives/xdocs faq.xml navigation.xml Log: update faq Revision Changes Path 1.2 +12 -8 jakarta-commons/primitives/xdocs/faq.xml Index: faq.xml =================================================================== RCS file: /home/cvs/jakarta-commons/primitives/xdocs/faq.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- faq.xml 16 Nov 2003 23:20:21 -0000 1.1 +++ faq.xml 17 Nov 2003 21:00:44 -0000 1.2 @@ -15,7 +15,7 @@ <dd> <p> The main advantage of the primitive collections is that they are signficantly smaller than their java.util equivalents. -How much smaller? Well, consider this table: +How much smaller? </p> <table border="1" cellspacing="0"> <tr> @@ -82,26 +82,30 @@ data. </p> <p> -In the pre-autoboxing (JDK 1.5) world, you may also find the primitive collections easier +Finally, in the pre-autoboxing (JDK 1.5) world, you may also find the primitive collections easier to work with, since you'll waste fewer keystrokes manually boxing and un-boxing the primitives and their Object wrappers. For instance, to sum an ArrayList of Integers, you might write something like: </p> -<pre>int sum = 0; +<pre> +int sum = 0; for(Iterator iter = list.iterator(); iter.hasNext(); ) { sum += ((Integer)(iter.next())).intValue(); -}</pre> +} +</pre> <p> The IntList equivalent would be: </p> -<pre>int sum = 0; +<pre> +int sum = 0; for(IntIterator iter = list.iterator(); iter.hasNext(); ) { sum += iter.next(); -}</pre> +} +</pre> </dd> -<dt>Q: But isn't this overkill? Aren't the time and space efficiencies -insignificant for the size and number of collections used by most applications?</dt> +<dt>Q: But aren't the time and space efficiencies insignificant for +the size and number of collections used by most applications?</dt> <dd> <p> Yes. 1.3 +1 -0 jakarta-commons/primitives/xdocs/navigation.xml Index: navigation.xml =================================================================== RCS file: /home/cvs/jakarta-commons/primitives/xdocs/navigation.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- navigation.xml 27 Oct 2003 20:55:56 -0000 1.2 +++ navigation.xml 17 Nov 2003 21:00:44 -0000 1.3 @@ -8,6 +8,7 @@ <body> <menu name="Commons Primitives"> <item name="Overview" href="/index.html"/> + <item name="FAQ" href="/faq.html"/> </menu> &commons-nav; </body>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]