Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ivagonz-practica4
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-practica4
Commits
2b7d759d
There was a problem fetching the pipeline summary.
Commit
2b7d759d
authored
Jan 10, 2018
by
Ivan Gonzalez
Browse files
Options
Downloads
Patches
Plain Diff
Constructor de colaDeAmigos implementado
parent
4e93aa37
No related branches found
No related tags found
2 merge requests
!3
Develop
,
!2
Cola
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/inf/uva/es/ivagonz/practica4/ColaDeAmigos.java
+23
-2
23 additions, 2 deletions
src/main/java/inf/uva/es/ivagonz/practica4/ColaDeAmigos.java
with
23 additions
and
2 deletions
src/main/java/inf/uva/es/ivagonz/practica4/ColaDeAmigos.java
+
23
−
2
View file @
2b7d759d
...
...
@@ -25,7 +25,28 @@ public class ColaDeAmigos {
* parámetro.
*/
public
ColaDeAmigos
(
ArrayList
<
Persona
>
cola
)
{
// TODO Auto-generated constructor stub
if
(
cola
==
null
)
throw
new
IllegalArgumentException
(
"La lista no puede ser nula."
);
if
(
hasElementoNull
(
cola
))
throw
new
IllegalArgumentException
(
"La cola no puede tener elementos nulos."
);
this
.
cola
=
cola
;
}
/**
* Comprueba si la lista pasada como parámetro tiene algún elemento nulo.
*
* @param lista
* Lista a comprobar si tiene elementos nulos. Debe ser correcta:
* No nula.
* @return true si la lista tiene algún elemento nulo, false en caso
* contrario.
*/
public
boolean
hasElementoNull
(
ArrayList
<
Persona
>
lista
)
{
for
(
int
i
=
0
;
i
<
lista
.
size
();
i
++)
{
if
(
lista
.
get
(
i
)
==
null
)
return
true
;
}
return
false
;
}
/**
...
...
@@ -34,7 +55,7 @@ public class ColaDeAmigos {
*/
public
ArrayList
<
Persona
>
getCola
()
{
// TODO Auto-generated method stub
return
null
;
return
cola
;
}
/**
...
...
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
register
or
sign in
to comment