package project_3;

public class Country implements Comparable<Country>{
	private String name;
	private double totalNo;
	private LinkedList<City> list = new LinkedList<>();
	
	public Country(String name) {
		this.name = name;
	}
	
	

	public void addCity(City c){
	    list.add(c);
	    totalNo+=c.getTouristNo();
	}

	public double getTotalNo() {
		return totalNo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getCities(){
		String s="";
		for (int i = 0; i < list.getSize(); i++) {
			s+=list.getIndexData(i).getName()+",";
		}
		return s;
	}
	public int getNoOfCities(){
		return list.getSize();
	}
	@Override
	public String toString() {
		return "Name :"+ name  ;
	}
	
	public void printList(){
		list.print();
	}
	
	public LinkedList<City> getList() {
		return list;
	}
	@Override
	public int compareTo(Country o) {
		return this.name.compareTo(o.name);
	
	}
	public boolean equals(Object c){
		return this.name.equals(((Country)c).getName());
	}

}
