import java.util.ArrayList;
public class Stadt extends NamedObject
{
	public Stadt (String name, Land liegt_in) throws Exception
	{
		super (name);
		setLiegt_in(liegt_in);
	}
	Land Liegt_in;
	public Land getLiegt_in() 
	{
		return Liegt_in;
	}
	public void setLiegt_in(Land liegt_in) throws Exception 
	{
		if (liegt_in == null)
		{
			throw new Exception("Land liegt_in has to have a value.");
		}		
		Liegt_in = liegt_in;
	}
	ArrayList<Fluss> Liegt_an = new ArrayList<Fluss>();
	public ArrayList<Fluss> getLiegt_an() 
	{
		return Liegt_an;
	}
	
	public String getDescription()
	{
		String result = getName();
		for (int i = 0; i < getLiegt_an().size(); i++)
		{			
			Fluss currentFluss = getLiegt_an().get(i);
			if (currentFluss.isMale())
			{
				result = result + " am " + currentFluss.getName();
			}
			else
			{
				result = result + " an der " + currentFluss.getName();				
			}
		}
		result += " liegt in " + getLiegt_in().getName();
		return result;
	}
	
}
