package jondo;

import anon.infoservice.ServiceLocation;
import anon.util.CountryMapper;
import anon.util.JAPMessages;

public class MixLocation 
{
	private ServiceLocation m_location;
	
	protected MixLocation(ServiceLocation a_location)
	{
		if (a_location == null)
		{
			throw new NullPointerException();
		}
		m_location = a_location;
	}
	
	public String getCity()
	{
		return m_location.getCity();
	}
	
	public String getState()
	{
		return m_location.getState();
	}
	
	public String getCountryCode()
	{
		return m_location.getCountryCode();
	}
	
	public String getCountry()
	{
		try
		{
			return new CountryMapper(
					m_location.getCountryCode(), JAPMessages.getLocale()).toString();
		}
		catch (IllegalArgumentException a_e)
		{
			return m_location.getCountryCode();
		}
	}
	
	public String getLatitude()
	{
		return m_location.getLatitude();
	}
	
	public String getLongitude()
	{
		return m_location.getLongitude();
	}
}
