Here is how I declared my list. it.next() appears to be returning my set when it should be returning a pair (which is a string,int pair) in one of my lists. Any ideas?
The method getFirst() is undefined for the type Object..It seems that if I do this , it fixes this.
String m=((Pair) it.next()).getFirst();
List <HashSet<Pair>> addresses = new ArrayList <HashSet<Pair>> ();
for (int i = 0; i < 100; i++) {
Iterator it = (addresses.get(i)).iterator();
while (it.hasNext()){
String m = it.next().getFirst()); //getFirst returns a string
}
}
Try this, it compiles just fine:
Of course, you’ll have to populate the list of addresses with sets of pairs for the above to do something useful.