Multiple lists used in for()

I'd like to be able to "scroll through" three different lists (all of the same length) and do things to the vars:

List<String> urls =new ArrayList<String>();

List<String> searchStrings =new ArrayList<String>();

List<String> thresholds =new ArrayList<String>();

urls = xmlp.get("url");

searchStrings = xmlp.get("searchString");

thresholds = xmlp.get("threshold");

for (String url : urls){

System.out.println(url);

}

Is there a way to do this in Java though like the Python for... zip(vars)

example:

for url, searchString, threshold in zip(urls,searchStrings,thresholds):

dothis with url

dothis with searchString

dothis with threshold

Is there an equivilent for Java?

Thanks

[1315 byte] By [hseritta] at [2007-11-27 6:46:59]
# 1
If the lists are all the same length then just use a plain old for loop.
floundera at 2007-7-12 18:19:29 > top of Java-index,Java Essentials,Java Programming...
# 2

not sure if it can be done in for-each loop. but it's possible with basic for loop.

for (Iterator<String> i1=urls.iterator(), i2 = searchStrings.iterator(), i3 = thresholds.iterator(); i1.hasNext(); ) {

System.out.println(i1.next());

System.out.println(i2.next());

System.out.println(i3.next());

}

j_shadinataa at 2007-7-12 18:19:29 > top of Java-index,Java Essentials,Java Programming...
# 3
I'd probably have arranged a class with a search, url, and a threshold, and looped through a list of one of those. A simple for loop would suffice, however... just a little more wordy than in the Python equivalent.
kevjavaa at 2007-7-12 18:19:29 > top of Java-index,Java Essentials,Java Programming...