Hello my situation is that:
Vector<Word> _words = new Vector<Word>();
//fill the vector
Map<String, Integer> tham = new HashMap();
//fill the map
..................................
for ( String w : _words) {
Collection c = tham.values();
Iterator it= c.iterator();
int value = 0;
for ( String s : tham.keySet() ) {
System.out.println(" -- string -- " + s);
if ( s.equals( w )) {
System.out.println(" -- string -- " + s);
value = (Integer) it.next();
}
else it.next();
}
}
Vector<Word> _words = new Vector<Word>();
//fill the vector
Map<String, Integer> tham = new HashMap();
//fill the map
..................................
for ( String w : _words) {
Collection c = tham.values();
Iterator it= c.iterator();
int value = 0;
for ( String s : tham.keySet() ) {
System.out.println(" -- string -- " + s);
if ( s.equals( w )) {
System.out.println(" -- string -- " + s);
value = (Integer) it.next();
}
else it.next();
}
}
To copy to clipboard, switch view to plain text mode
This should work but it very slow. Is there a way to retrieve the Integer value of the Map with iterate on 'tham' all the times?
thanks,
Bookmarks