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 */ 011public abstract class AbstractDatum implements Datum { 012 013 protected String name; 014 protected String proj4Id; 015 protected Ellipsoid ellps; 016 017 /** 018 * Constructs a new {@code AbstractDatum}. 019 * @param name The name 020 * @param proj4Id The Proj4 identifier 021 * @param ellps The ellipsoid 022 */ 023 public AbstractDatum(String name, String proj4Id, Ellipsoid ellps) { 024 this.name = name; 025 this.proj4Id = proj4Id; 026 this.ellps = ellps; 027 } 028 029 @Override 030 public String getName() { 031 return name; 032 } 033 034 @Override 035 public String getProj4Id() { 036 return proj4Id; 037 } 038 039 @Override 040 public Ellipsoid getEllipsoid() { 041 return ellps; 042 } 043}