package daruma.geometry;

public class CoordinateSystem
{
    private String srsName;

    public CoordinateSystem()
    {
	this.srsName = null;
    }

    public CoordinateSystem( String srsName )
    {
	this.srsName = srsName;
    }

    public String getSrsName()
    {
	return srsName;
    }

    @Override
    public boolean equals( Object obj )
    {
	if ( this == obj )
	{
	    return true;
	}

	if ( obj == null )
	{
	    return false;
	}

	if ( ! (obj instanceof CoordinateSystem) )
	{
	    return false;
	}

	CoordinateSystem c = (CoordinateSystem)obj;

	if ( this.srsName == null )
	{
	    return c.getSrsName() == null;
	}
	else
	{
	    return this.srsName.equals( c.getSrsName() );
	}
    }

    @Override
    public int hashCode()
    {
	if ( this.srsName == null )
	{
	    return 0;
	}
	else
	{
	    return this.srsName.hashCode();
	}
    }
}
