Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
preparacionPOO
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
javrami
preparacionPOO
Commits
571b9143
Commit
571b9143
authored
Jan 12, 2021
by
carmuno
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
05348526
d47dc0c7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Ordinario2015_16/Buffer.java
+40
-46
40 additions, 46 deletions
src/Ordinario2015_16/Buffer.java
src/ord_16_17/Coleccion.java
+2
-19
2 additions, 19 deletions
src/ord_16_17/Coleccion.java
with
42 additions
and
65 deletions
src/Ordinario2015_16/Buffer.java
+
40
−
46
View file @
571b9143
...
...
@@ -3,9 +3,9 @@ package Ordinario2015_16;
import
java.util.ArrayList
;
/*
*
*
@author Carlos Noé Muñoz
* @author Sergio Gómez Conde.
* @version 1.
0
* @version 1.
2
*/
public
class
Buffer
<
E
extends
Prioridad
>
{
//almacena objetos que esos objetos implementan esa interfaz, de ahi que
...
...
@@ -15,31 +15,25 @@ public class Buffer<E extends Prioridad> {//almacena objetos que esos objetos i
public
Buffer
()
{
lista
=
new
ArrayList
<>();
}
//ojo este metodo creoq eu esta correcto pq introduces con orden de prioridad pero
//tb mantienes dentro orden de llegada?
public
void
mete
(
E
c
)
{
public
void
mete
(
E
e
)
{
if
(
e
.
prioridad
()
==
0
)
{
lista
.
add
(
0
,
e
);
}
else
if
(
e
.
prioridad
()
==
1
)
{
for
(
int
i
=
0
;
i
<
lista
.
size
();
i
++)
{
if
(
lista
.
get
(
i
).
prioridad
()
==
1
)
{
lista
.
add
(
i
,
e
);
}
}
}
else
{
for
(
int
i
=
0
;
i
<
lista
.
size
();
i
++)
{
if
(
lista
.
get
(
i
).
prioridad
()
==
2
)
{
lista
.
add
(
i
,
e
);
}
if
(
lista
.
get
(
0
).
isEmpty
){
throws
new
NullPointerException
();}
for
(
int
i
=
0
;
i
<
arraybuffer
.
size
();
i
++)
throw
NullPointerException
{
if
((
arraybuffer
.
get
(
i
).
getPrioridad
())
<
c
.
getPrioridad
())
{
arraybuffer
.
add
(
i
,
c
);
}
}
}
public
E
primero
()
{
public
E
atender
()
throw
NullPointerException
{
if
(
lista
.
get
(
0
).
isEmpty
){
throws
new
NullPointerException
();}
return
lista
.
get
(
0
);
}
public
void
saca
()
{
public
void
saca
()
throw
NullPointerException
{
if
(
lista
.
get
(
0
).
isEmpty
){
throws
new
NullPointerException
();}
lista
.
remove
(
0
);
}
...
...
This diff is collapsed.
Click to expand it.
src/ord_16_17/Coleccion.java
+
2
−
19
View file @
571b9143
...
...
@@ -48,32 +48,15 @@ public class Coleccion <E extends Play> {
}
public
boolean
listavacia
()
{
return
lista
.
isEmpty
();
}
public
ArrayList
<
E
>
getLista
(){
return
(
ArrayList
<
E
>)
lista
.
clone
();
}
public
Coleccion
<
E
>
concatenar
(
Coleccion
<
E
>
collecion
){
Coleccion
<
E
>
newColeccion
=
new
Coleccion
<
E
>();
for
(
E
play
:
lista
)
{
newColeccion
.
add
(
play
);
}
for
(
E
play
:
collecion
.
getLista
())
{
newColeccion
.
add
(
play
);
}
return
newColeccion
;
public
void
concatenaColeccion
(
Coleccion
<
E
>
c
)
{
coleccion
.
addAll
(
c
.
obtenerColeccion
());
}
...
...
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