Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
UyTube_obligatorio_PdA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Juan José Álvarez Pérez
UyTube_obligatorio_PdA
Commits
9a2d4aec
Commit
9a2d4aec
authored
5 years ago
by
Julio Arrieta
Browse files
Options
Downloads
Patches
Plain Diff
Se agrega el codigo a los metodos 'listarComentarios, agregarModificarValoracion'
parent
e15f8a6e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
UyTube_aplicacion/src/Logica/Clases/Video.java
+17
-5
17 additions, 5 deletions
UyTube_aplicacion/src/Logica/Clases/Video.java
with
17 additions
and
5 deletions
UyTube_aplicacion/src/Logica/Clases/Video.java
+
17
−
5
View file @
9a2d4aec
...
...
@@ -51,12 +51,20 @@ public class Video {
/* Agregar un subcomentario a un comentario existente */
public
void
agregarComentario
(
int
idCom
,
DtComentario
dtComentario
,
Usuario
usuario
){
for
(
Map
.
Entry
<
Integer
,
Comentario
>
coment
:
comentarios
.
entrySet
())
{
if
(
coment
.
getValue
().
agregarSubComentario
(
idCom
,
dtComentario
,
usuario
));
if
(
coment
.
getValue
().
agregarSubComentario
(
idCom
,
dtComentario
,
usuario
)){
break
;
}
}
}
/* Agrega o midifica una valoración */
public
void
agregarModificarValoracion
(
DtValoracion
dtValoracion
,
Usuario
usuario
){
String
nickname
=
usuario
.
getNickname
();
for
(
Valoracion
val:
valoraciones
){
if
(
val
.
modificar
(
dtValoracion
,
nickname
)){
break
;
}
}
}
public
DtVideo
getDt
(){
...
...
@@ -64,8 +72,12 @@ public class Video {
}
public
ArrayList
<
DtComentario
>
listarComentarios
(){
// provisorio
return
new
ArrayList
();
ArrayList
<
DtComentario
>
listaComent
=
new
ArrayList
<
DtComentario
>();
for
(
Map
.
Entry
<
Integer
,
Comentario
>
coment
:
comentarios
.
entrySet
())
{
DtComentario
dtComent
=
new
DtComentario
(
coment
.
getValue
().
getId
(),
coment
.
getValue
().
getUsr
().
getNickname
(),
coment
.
getValue
().
getFecha
(),
coment
.
getValue
().
getTexto
(),
coment
.
getValue
().
getNivelSubComentario
());
listaComent
.
add
(
dtComent
);
}
return
listaComent
;
}
public
ArrayList
<
DtValoracion
>
listarValoraciones
(){
...
...
@@ -78,8 +90,8 @@ public class Video {
}
/* Sin terminar */
public
DtValoracion
obtenerValoracion
(
String
nickname
){
// provisorio
return
new
DtValoracion
();
}
...
...
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