PageRenderTime 26ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/Prototipo/PrototipoCommons/src/memoria/commons/structures/coordinates/LatLonCoordinate.java

http://prototipomemoria.googlecode.com/
Java | 59 lines | 34 code | 17 blank | 8 comment | 0 complexity | 794f2c9277ebb13d5884038640e3220b MD5 | raw file
 1/*
 2 * To change this template, choose Tools | Templates
 3 * and open the template in the editor.
 4 */
 5
 6package memoria.commons.structures.coordinates;
 7
 8/**
 9 *
10 * @author diego
11 */
12public class LatLonCoordinate extends Coordinate{
13
14    public double getLatitude(){
15        return Double.parseDouble(this.getY());
16    }
17
18     public double getLongitude(){
19        return Double.parseDouble(this.getX());
20    }
21
22    public LatLonCoordinate(String latitude, String longitude) {
23        this.setX(longitude);
24        this.setY(latitude);
25    }
26
27    public LatLonCoordinate(Double latitude, Double longitude) {
28        this.setX(longitude.toString());
29        this.setY(latitude.toString());
30    }
31
32    public LatLonCoordinate(Double latitude, Double longitude, Double altitude) {
33        this.setX(longitude.toString());
34        this.setY(latitude.toString());
35        this.setZ(altitude.toString());
36    }
37
38    @Override
39    public double to_double_x() {
40        return getLongitude();
41    }
42
43    @Override
44    public double to_double_y() {
45        return getLatitude();
46    }
47
48    @Override
49    public double to_double_z() {
50        return Double.parseDouble(this.getZ());
51    }
52
53
54
55
56
57
58
59}