Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ivagonz-antroma-practica2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ivagonz
ivagonz-antroma-practica2
Commits
705262cd
Commit
705262cd
authored
Dec 23, 2017
by
ivagonz
Browse files
Options
Downloads
Patches
Plain Diff
Implementada la clase DireccionGPS, pasando todos los test TDD
parent
d11789df
Branches
Branches containing commit
No related tags found
1 merge request
!1
Direccion gps
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/uva/tds/pr2/equipo10/DireccionGPS.java
+17
-6
17 additions, 6 deletions
src/main/java/uva/tds/pr2/equipo10/DireccionGPS.java
with
17 additions
and
6 deletions
src/main/java/uva/tds/pr2/equipo10/DireccionGPS.java
+
17
−
6
View file @
705262cd
package
uva.tds.pr2.equipo10
;
/**
* Implementación de una DirecciónGPS para la segunda práctica de la asignatura
* TDS.
...
...
@@ -10,6 +9,9 @@ package uva.tds.pr2.equipo10;
*/
public
class
DireccionGPS
{
private
double
latitud
;
private
double
longitud
;
/**
* Constructor de una dirección GPS.
*
...
...
@@ -24,24 +26,33 @@ public class DireccionGPS {
* los argumentos del constructor.
*/
public
DireccionGPS
(
double
latitud
,
double
longitud
)
{
int
a
=
0
;
if
(
latitud
<
-
180
)
throw
new
IllegalArgumentException
(
"La latitud debe ser mayor o igual a -180"
);
if
(
latitud
>
180
)
throw
new
IllegalArgumentException
(
"La latitud debe ser menor o igual a 180"
);
if
(
longitud
<
-
180
)
throw
new
IllegalArgumentException
(
"La longitud debe ser mayor o igual a -180"
);
if
(
longitud
>
180
)
throw
new
IllegalArgumentException
(
"La longitud debe ser menor o igual a 180"
);
this
.
latitud
=
latitud
;
this
.
longitud
=
longitud
;
}
/**
* @return latitud de la DireccionGPS.
*/
public
int
getLatitud
()
{
public
double
getLatitud
()
{
// TODO Auto-generated method stub
return
0
;
return
latitud
;
}
/**
*
* @return longitud de la DireccionGPS .
*/
public
int
getLongitud
()
{
public
double
getLongitud
()
{
// TODO Auto-generated method stub
return
0
;
return
longitud
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment