You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.6 KiB
53 lines
1.6 KiB
2 years ago
|
/*
|
||
|
* To change this license header, choose License Headers in Project Properties.
|
||
|
* To change this template file, choose Tools | Templates
|
||
|
* and open the template in the editor.
|
||
|
*/
|
||
|
package rulespecs2;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @author denis
|
||
|
*/
|
||
|
public class RulesPECS2 {
|
||
|
|
||
|
/**
|
||
|
* @param args the command line arguments
|
||
|
*/
|
||
|
public static void main(String[] args) {
|
||
|
RulesPECS2 pecs = new RulesPECS2();
|
||
|
List<Country> countrys = new ArrayList<>();
|
||
|
pecs.consumerCity(countrys);
|
||
|
pecs.consumerStreet(countrys);
|
||
|
pecs.consumerDistrict(countrys);
|
||
|
|
||
|
countrys.forEach(System.out::println);
|
||
|
}
|
||
|
|
||
|
|
||
|
public void producer(List<? extends District> list){
|
||
|
|
||
|
}
|
||
|
|
||
|
public void consumerStreet(List<? super Street> list){
|
||
|
list.add(new Street("Ленинский пр.", "Кировский", "Санкт-Петербург", "Россия"));
|
||
|
list.add(new Street("Московский пр.", "Московский", "Санкт-Петербург", "Россия"));
|
||
|
list.add(new Street("Стачек пр.", "Кировский", "Санкт-Петербург", "Россия"));
|
||
|
}
|
||
|
|
||
|
public void consumerDistrict(List<? super District> list){
|
||
|
list.add(new District("Невский", "Санкт-Петербург", "Россия"));
|
||
|
}
|
||
|
|
||
|
public void consumerCity(List<? super City> list){
|
||
|
list.add(new City("Санкт-Петербург", "Россия"));
|
||
|
}
|
||
|
|
||
|
public void method(List<District> list){
|
||
|
|
||
|
}
|
||
|
}
|