Commit 3e4ca921 authored by Julian Zobel's avatar Julian Zobel 🦄
Browse files

Default implementation for several Location-related functions that are not...

Default implementation for several Location-related functions that are not necessary/useful for every implementing class. Throw UnsupportedOperationException if not overwritten by implementation.
parent d971b072
......@@ -38,11 +38,17 @@ import de.tudarmstadt.maki.simonstrator.api.common.Transmitable;
public interface Location extends Transmitable, Cloneable {
/**
* Sets the contents of this location object to the specified location
* Sets the contents of this location object to the specified location.
* Throws an {@link UnsupportedOperationException}, if altering the location
* information is not permitted.
*
* In general: use constructor to set location information
*
* @param l
*/
public void set(Location l);
default public void set(Location l) {
throw new UnsupportedOperationException();
};
@Deprecated
default public double getLatitude() {
......@@ -151,7 +157,9 @@ public interface Location extends Transmitable, Cloneable {
*
* @return
*/
public long getAgeOfLocation();
default public long getAgeOfLocation() {
throw new UnsupportedOperationException();
}
/**
* Bearing (or heading) of the current movement vector in degrees between 0
......@@ -231,7 +239,9 @@ public interface Location extends Transmitable, Cloneable {
* @return bearing angle between this and dest, counting clockwise from true
* north.
*/
public float bearingTo(Location dest);
default public float bearingTo(Location dest) {
throw new UnsupportedOperationException();
}
/**
* Copy of the current location (use this to retrieve a valid
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment