![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programmer
Join Date: Dec 2005
Posts: 40
Rep Power: 0
![]() |
If i had an array called List and was able to iterate through it, pulling out each element like this:
for(i = 0 ; i< List.size()-4 ; i++){
System.out.println(seqList.get(i));
}Is there any way to use this piece of code provided by titaniumdecoy: double x = map.get('A')[0];but like this: double x = map.get(seqList.get(i))[0]; So i don't have to check what value 'i' is before i assign it a value from the map? ^^^Thats giving me errors. |
|
|
|
|
|
#12 |
|
Expert Programmer
|
If you want to iterate through the set of double values assigned to a particular letter in the map, you can do the following:
for (double i : map.get('A')) {
System.out.println(i);
}If instead you want to iterate through the first double value assigned to each letter value in the map: for (char i : map.keySet()) {
System.out.println(map.get(i)[0]);
} |
|
|
|
|
|
#13 |
|
Programmer
Join Date: Dec 2005
Posts: 40
Rep Power: 0
![]() |
I worked something out. Incedently, does anyone know how to auto-indent an entire piece of code in Netbeans? Im using version 5.0.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|