]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/data/Longitude.java
Version 4, January 2008
[GpsPrune.git] / tim / prune / data / Longitude.java
index d61adbc2ce2f96dd3e5c9fd0d25a2b5f52f17bd2..b4c04139d5046db1b218b1b52e6019cd2035126c 100644 (file)
@@ -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;
+       }
 }