N
news.amnet.net.au
Hi
I found that I need to store a collection of objects as ArrayLists inside
another ArrayList, because if I store my (objects in the) ArrayLists in a
Map type Collection, iterating over the map does not give me first key in ->
first key out.
It was suggested to me I use LinkedHashMap, but that only exists in Java
platform 1.4 and I am working with 1.3.1 as this is what is available within
my Oracle environment.
Hopefully an ArrayList of ArrayLists will give me FIFO.
Excuse my ignorance on this one as I have never used an ArrayList of
ArrayLists - my question is: how do I get the values out?
My "outer" ArrayList is called indexed_relationships and the inner ones are
all called "p", (both have been declared and initialised earlier on) I
tried:
I have tried several things, but none work. For example, I tried ( I know
this is wrong, but it is what I could think of):
for(int i = 0; i < indexed_relationships.size(); i++ ) {
for (int j = 0; j < p.size(); j++) {
System.out.println(indexed_relationships.get(i).get(j).toString() +
"<br/>");
}
}
Any help will be greatly appreciated.
Thanks very much
Hugo
I found that I need to store a collection of objects as ArrayLists inside
another ArrayList, because if I store my (objects in the) ArrayLists in a
Map type Collection, iterating over the map does not give me first key in ->
first key out.
It was suggested to me I use LinkedHashMap, but that only exists in Java
platform 1.4 and I am working with 1.3.1 as this is what is available within
my Oracle environment.
Hopefully an ArrayList of ArrayLists will give me FIFO.
Excuse my ignorance on this one as I have never used an ArrayList of
ArrayLists - my question is: how do I get the values out?
My "outer" ArrayList is called indexed_relationships and the inner ones are
all called "p", (both have been declared and initialised earlier on) I
tried:
I have tried several things, but none work. For example, I tried ( I know
this is wrong, but it is what I could think of):
for(int i = 0; i < indexed_relationships.size(); i++ ) {
for (int j = 0; j < p.size(); j++) {
System.out.println(indexed_relationships.get(i).get(j).toString() +
"<br/>");
}
}
Any help will be greatly appreciated.
Thanks very much
Hugo