PageRenderTime 21ms CodeModel.GetById 17ms RepoModel.GetById 0ms 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
Possible License(s): BSD-3-Clause
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package memoria.commons.structures.coordinates;
  6. /**
  7. *
  8. * @author diego
  9. */
  10. public class LatLonCoordinate extends Coordinate{
  11. public double getLatitude(){
  12. return Double.parseDouble(this.getY());
  13. }
  14. public double getLongitude(){
  15. return Double.parseDouble(this.getX());
  16. }
  17. public LatLonCoordinate(String latitude, String longitude) {
  18. this.setX(longitude);
  19. this.setY(latitude);
  20. }
  21. public LatLonCoordinate(Double latitude, Double longitude) {
  22. this.setX(longitude.toString());
  23. this.setY(latitude.toString());
  24. }
  25. public LatLonCoordinate(Double latitude, Double longitude, Double altitude) {
  26. this.setX(longitude.toString());
  27. this.setY(latitude.toString());
  28. this.setZ(altitude.toString());
  29. }
  30. @Override
  31. public double to_double_x() {
  32. return getLongitude();
  33. }
  34. @Override
  35. public double to_double_y() {
  36. return getLatitude();
  37. }
  38. @Override
  39. public double to_double_z() {
  40. return Double.parseDouble(this.getZ());
  41. }
  42. }