Re: Problems with Map.size()..........
- From: Thomas Weidenfeller <nobody@xxxxxxxxxxxxxxxx>
- Date: Wed, 31 May 2006 17:08:09 +0200
gbattine wrote:
It's too low of one unit and i don't understand he cause
Think harder.
^^int numberOfNumericColumns = (st.countTokens()-1);
/*
* Get the first token from the line. It will be a String
and
its value will be a unique key for the rest of the row.
*/
String key = st.nextToken().trim();
key is never added to the map. So of course there is one element less in the map than columns in the file. Always.
If you re-read my original post, you will find that I sad that there are Map.size() (-1) columns in the map. I wrote that -1 for a reason.
/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
.
- References:
- Problems with Map.size()..........
- From: gbattine
- Re: Problems with Map.size()..........
- From: chris brat
- Re: Problems with Map.size()..........
- From: gbattine
- Problems with Map.size()..........
- Prev by Date: EnumSet + contains: strange behavior
- Next by Date: SoftReference operation synchronization detail
- Previous by thread: Re: Problems with Map.size()..........
- Next by thread: HTML Upload?
- Index(es):
Relevant Pages
|