/
sharp1024
/
homework5
Обзор
Документация
Войти
/
sharp1024
/
homework5
Код
Запросы
1
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/ru/edu/lesson6/TravelService.java
63 строки
2 KB
RodinRoman
init
13 янв 2022, 01:07
13 янв 2022, 01:07
f01d413
Код
Авторство
О чём код?
package ru.edu.lesson6; import java.util.ArrayList; import java.util.List; /** * Travel Service. */ public class TravelService { // do not change type private final List<CityInfo> cities = new ArrayList<>(); /** * Append city info. * * @param cityInfo - city info * @throws IllegalArgumentException if city already exists */ public void add(CityInfo cityInfo) { // do something } /** * remove city info. * * @param cityName - city name * @throws IllegalArgumentException if city doesn't exist */ public void remove(String cityName) { // do something } /** * Get cities names. */ public List<String> citiesNames() { return null; } /** * Get distance in kilometers between two cities. * https://www.kobzarev.com/programming/calculation-of-distances-between-cities-on-their-coordinates/ * * @param srcCityName - source city * @param destCityName - destination city * @throws IllegalArgumentException if source or destination city doesn't exist. */ public int getDistance(String srcCityName, String destCityName) { return 0; } /** * Get all cities near current city in radius. * * @param cityName - city * @param radius - radius in kilometers for search * @throws IllegalArgumentException if city with cityName city doesn't exist. */ public List<String> getCitiesNear(String cityName, int radius) { return null; } }