Skip to content
Station.java 1.24 KiB
Newer Older
xtof's avatar
xtof committed
package org.josast.SIDS;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

xtof's avatar
xtof committed
public class Station {
xtof's avatar
xtof committed

    private String callsign = "XtopheSwl";
    private String longitude = "1.47E";
    private String latitude = "43.56N";
    public Station(final String callsign, final String longitude, final String latitude) {
    super();
    this.callsign = callsign;
    this.longitude = longitude;
    this.latitude = latitude;
	public Station() {
		// TODO Auto-generated constructor stub
	}
xtof's avatar
xtof committed
	public String getCallsign() {
		return callsign;
	}
xtof's avatar
xtof committed
	public void setCallsign(final String callsign) {
xtof's avatar
xtof committed
		this.callsign = callsign;
	}
	public String getLongitude() {
		return longitude;
	}
xtof's avatar
xtof committed
	public void setLongitude(final String longitude) {
xtof's avatar
xtof committed
		this.longitude = longitude;
	}
	public String getLatitude() {
		return latitude;
	}
xtof's avatar
xtof committed
	public void setLatitude(final String latitude) {
xtof's avatar
xtof committed
		this.latitude = latitude;
	}
xtof's avatar
xtof committed

	public boolean checkLatitude(final String latitude) {

		Pattern p = Pattern.compile("[\\d]*\\.[\\d]*[N,S]");
		Matcher m = p.matcher(latitude);
		return  m.matches();

	}
	public boolean checkLongitude(final String longitude) {

		Pattern p = Pattern.compile("[\\d]*\\.[\\d]*[E,W]");
		Matcher m = p.matcher(longitude);
		return  m.matches();

	}

xtof's avatar
xtof committed


}