001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data.projection.datum;
003
004import org.openstreetmap.josm.data.projection.Ellipsoid;
005
006/**
007 * Abstract base class for {@link Datum} implementations.
008 *
009 * Adds common fields and access methods.
010 * @since 4285
011 */
012public abstract class AbstractDatum implements Datum {
013
014    protected String name;
015    protected String proj4Id;
016    protected Ellipsoid ellps;
017
018    /**
019     * Constructs a new {@code AbstractDatum}.
020     * @param name The name
021     * @param proj4Id The Proj4 identifier
022     * @param ellps The ellipsoid
023     */
024    protected AbstractDatum(String name, String proj4Id, Ellipsoid ellps) {
025        this.name = name;
026        this.proj4Id = proj4Id;
027        this.ellps = ellps;
028    }
029
030    @Override
031    public String getName() {
032        return name;
033    }
034
035    @Override
036    public String getProj4Id() {
037        return proj4Id;
038    }
039
040    @Override
041    public Ellipsoid getEllipsoid() {
042        return ellps;
043    }
044}