Advertisement
Guest User

Untitled

a guest
May 30th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. private static Function<?, ?> addStateToCity(String city, String state) {
  2.  
  3. // make sure that the combination of city/state is unique
  4. // as there may be multiple zipcode records for a city
  5.  
  6. CityStates cityInStates = cityStates.get(city);
  7.  
  8. if (cityInStates == null) {
  9. cityStates.put(city, new CityStates(city, state));
  10. } else {
  11. if (!cityInStates.statesContainsState(state)) {
  12. cityInStates.addState(state);
  13. cityStates.put(city, cityInStates);
  14. }
  15. }
  16. return null;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement