Part 2 Update: Data dictionaries and notes about Cities

Please see the corresponding section in the specification for Part 1 if you remain unsure about the objects and elements of the JAVA API appropriate for representing cities. The bulk of this section deals with the modifications to the data dictionary required for parts 2 and 3.

We have alluded to the fact that you are going to have to maintain a dictionary (a collection) of all the cities we create using the createCity command throughout the entire project. For both Part 2 and Part 3, need to be able to find cities based on their $ (x,y)$ coordinates, since aside from two cities bearing the same name being illegal, two cities cannot occupy the same $ (x,y)$ coordinate. The treemap and comparator for two-dimensional coordinates from Part 1 is sufficient to check for uniqueness of the coordinate-city name assignment for for Part 2 and Part 3. However, you may see a new command which requires you to do a search for cities with coordinates satisfying a given rule in Part 2, and will definitely see it in Part 3. The comparator for city coordinates will remain the unchanged. That is, it must sort $ (x,y)$ coordinates in the following fashion: sort on the $ y$ coordinate first in ascending order; if two cities have the same $ y$ coordinate, compare their $ x$ coordinates, and place the one with the smallest $ x$ coordinate first.

MM Hugue 2018-10-01