Advertisement
INSECURE-FLOWERPOT

Untitled

Feb 27th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. //START HERE
  2. if(!place.isEmpty())
  3. {
  4. //does this place exist?
  5.  
  6. int x = -1;
  7. //loop through all places and do manual check for place name
  8. for(int i=0; i<place.size(); i++)
  9. {
  10. Place lugar = place.get(i);
  11. if(lugar.getState().equals(tokens[3]))
  12. {
  13. x = i;
  14. break;
  15. }
  16. }
  17. if(x>=0)
  18. {
  19. //it does exist, add the city and state to that place
  20. Place lugar = place.get(x);
  21. lugar.addCity(tokens[2]);
  22. lugar.addPeople((tok[0]+" "+tok[1]+" "+tok[tok.length-1]));
  23. }
  24. else
  25. {
  26. place.add(new Place(tokens[2],tokens[3],tok[0],tok[1],tok[tok.length-1]));
  27. }
  28.  
  29. /*
  30. if(!place.contains(tokens[3]))
  31. {
  32.  
  33. place.add(new Place(tokens[2],tokens[3],tok[0],tok[1],tok[tok.length-1]));
  34. }
  35. else
  36. {
  37. System.out.println("?");
  38. place.add(new Place(tokens[2],tok[0],tok[1],tok[tok.length-1]));
  39.  
  40. }
  41. */
  42. }
  43. else
  44. {
  45.  
  46. place.add(new Place(tokens[2],tokens[3],tok[0],tok[1],tok[tok.length-1]));
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement