X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fdata%2FLongitude.java;h=b4c04139d5046db1b218b1b52e6019cd2035126c;hb=da0b1f449260a0b4a94318006382a9039726ef3e;hp=d61adbc2ce2f96dd3e5c9fd0d25a2b5f52f17bd2;hpb=312fec956e43f5d0a38617da5d0add9c62563e2c;p=GpsPrune.git diff --git a/tim/prune/data/Longitude.java b/tim/prune/data/Longitude.java index d61adbc..b4c0413 100644 --- a/tim/prune/data/Longitude.java +++ b/tim/prune/data/Longitude.java @@ -20,10 +20,9 @@ public class Longitude extends Coordinate * @param inValue value of coordinate * @param inFormat format to use */ - protected Longitude(double inValue, int inFormat) + public Longitude(double inValue, int inFormat) { - super(inValue, inFormat); - _cardinal = inValue < 0.0 ? WEST : EAST; + super(inValue, inFormat, inValue < 0.0 ? WEST : EAST); } @@ -34,8 +33,8 @@ public class Longitude extends Coordinate protected int getCardinal(char inChar) { // Longitude recognises E, W and - - // default is East - int cardinal = EAST; + // default is no cardinal + int cardinal = NO_CARDINAL; switch (inChar) { case 'E': @@ -52,6 +51,16 @@ public class Longitude extends Coordinate } + /** + * @return default cardinal (East) + * @see tim.prune.data.Coordinate#getDefaultCardinal() + */ + protected int getDefaultCardinal() + { + return EAST; + } + + /** * Make a new Longitude object * @see tim.prune.data.Coordinate#makeNew(double, int) @@ -61,4 +70,11 @@ public class Longitude extends Coordinate return new Longitude(inValue, inFormat); } + /** + * @return the maximum degree range for this coordinate + */ + protected int getMaxDegrees() + { + return 180; + } }