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
coordinates, since aside from two cities bearing the same name being
illegal, two cities cannot occupy the same
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
coordinates
in the following fashion:
sort on the
coordinate first in ascending order; if two cities have the
same
coordinate, compare their
coordinates, and place the one with the smallest
coordinate first.
MM Hugue 2017-10-12