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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Juan José Álvarez Pérez
UyTube_obligatorio_PdA
Commits
4ac631b3
Commit
4ac631b3
authored
Aug 22, 2019
by
Alfa-J
Browse files
Options
Downloads
Patches
Plain Diff
modificado el main para testeo, el resto andava
parent
deaa5298
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
UyTube_aplicacion/src/Logica/Clases/Comentario.java
+19
-20
19 additions, 20 deletions
UyTube_aplicacion/src/Logica/Clases/Comentario.java
UyTube_aplicacion/src/Logica/main.java
+11
-15
11 additions, 15 deletions
UyTube_aplicacion/src/Logica/main.java
with
30 additions
and
35 deletions
UyTube_aplicacion/src/Logica/Clases/Comentario.java
+
19
−
20
View file @
4ac631b3
...
@@ -5,6 +5,7 @@ import java.sql.Date;
...
@@ -5,6 +5,7 @@ import java.sql.Date;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
public
class
Comentario
{
public
class
Comentario
{
private
static
int
contadorComentarios
=
1
;
private
static
int
contadorComentarios
=
1
;
private
int
id
;
private
int
id
;
...
@@ -77,7 +78,6 @@ public class Comentario {
...
@@ -77,7 +78,6 @@ public class Comentario {
return
"Comentario{"
+
"id="
+
id
+
", fecha="
+
fecha
+
", texto="
+
texto
+
", nivelSubComentario="
+
nivelSubComentario
+
'}'
;
return
"Comentario{"
+
"id="
+
id
+
", fecha="
+
fecha
+
", texto="
+
texto
+
", nivelSubComentario="
+
nivelSubComentario
+
'}'
;
}
}
public
boolean
agregarSubComentario
(
int
idComPadre
,
DtComentario
dtC
,
Usuario
usr
)
{
public
boolean
agregarSubComentario
(
int
idComPadre
,
DtComentario
dtC
,
Usuario
usr
)
{
if
(
this
.
id
==
idComPadre
)
{
if
(
this
.
id
==
idComPadre
)
{
Comentario
com
=
new
Comentario
(
Comentario
.
getNuevoID
(),
Comentario
com
=
new
Comentario
(
Comentario
.
getNuevoID
(),
...
@@ -87,8 +87,7 @@ public class Comentario {
...
@@ -87,8 +87,7 @@ public class Comentario {
usr
);
usr
);
this
.
misComentario
.
add
(
com
);
this
.
misComentario
.
add
(
com
);
return
true
;
return
true
;
}
}
else
{
else
{
for
(
int
i
=
0
;
i
<
misComentario
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
misComentario
.
size
();
i
++)
{
if
(
this
.
misComentario
.
get
(
i
).
agregarSubComentario
(
idComPadre
,
dtC
,
usr
))
{
if
(
this
.
misComentario
.
get
(
i
).
agregarSubComentario
(
idComPadre
,
dtC
,
usr
))
{
...
...
This diff is collapsed.
Click to expand it.
UyTube_aplicacion/src/Logica/main.java
+
11
−
15
View file @
4ac631b3
...
@@ -9,32 +9,28 @@ import java.util.ArrayList;
...
@@ -9,32 +9,28 @@ import java.util.ArrayList;
public
class
main
{
public
class
main
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"Hola mundo"
);
System
.
out
.
println
(
"Hola mundo"
);
/*
Usuario u1 = new Usuario("nicku1", "email1", new Date(2019-1900,7,15), "c/imagenes/algo1.jpg", "1234", "carlos1", "perez1", null);
Usuario
u1
=
new
Usuario
(
"nicku1"
,
"email1"
,
new
Date
(
2019
-
1900
,
7
,
15
),
"c/imagenes/algo1.jpg"
,
"1234"
,
"carlos1"
,
"perez1"
,
null
);
Usuario
u2
=
new
Usuario
(
"nicku2"
,
"email2"
,
new
Date
(
2019
-
1900
,
7
,
15
),
"c/imagenes/algo2.jpg"
,
"1234"
,
"carlos2"
,
"perez2"
,
null
);
Usuario
u2
=
new
Usuario
(
"nicku2"
,
"email2"
,
new
Date
(
2019
-
1900
,
7
,
15
),
"c/imagenes/algo2.jpg"
,
"1234"
,
"carlos2"
,
"perez2"
,
null
);
Usuario
u3
=
new
Usuario
(
"nicku3"
,
"email3"
,
new
Date
(
2019
-
1900
,
7
,
15
),
"c/imagenes/algo3.jpg"
,
"1234"
,
"carlos3"
,
"perez3"
,
null
);
Usuario
u3
=
new
Usuario
(
"nicku3"
,
"email3"
,
new
Date
(
2019
-
1900
,
7
,
15
),
"c/imagenes/algo3.jpg"
,
"1234"
,
"carlos3"
,
"perez3"
,
null
);
Usuario
u4
=
new
Usuario
(
"nicku4"
,
"email4"
,
new
Date
(
2019
-
1900
,
7
,
15
),
"c/imagenes/algo4.jpg"
,
"1234"
,
"carlos4"
,
"perez4"
,
null
);
Usuario
u4
=
new
Usuario
(
"nicku4"
,
"email4"
,
new
Date
(
2019
-
1900
,
7
,
15
),
"c/imagenes/algo4.jpg"
,
"1234"
,
"carlos4"
,
"perez4"
,
null
);
Usuario
u5
=
new
Usuario
(
"nicku5"
,
"email5"
,
new
Date
(
2019
-
1900
,
7
,
15
),
"c/imagenes/algo5.jpg"
,
"1234"
,
"carlos5"
,
"perez5"
,
null
);
Usuario
u5
=
new
Usuario
(
"nicku5"
,
"email5"
,
new
Date
(
2019
-
1900
,
7
,
15
),
"c/imagenes/algo5.jpg"
,
"1234"
,
"carlos5"
,
"perez5"
,
null
);
Comentario c1 = new Comentario(Comentario.getNuevoID(), new Date(2019-1900,7,15), "1
: exelente video
", 0, u1);
Comentario
c1
=
new
Comentario
(
Comentario
.
getNuevoID
(),
new
Date
(
2019
-
1900
,
7
,
15
),
"1"
,
0
,
u1
);
c1.agregarSubComentario(c1.getId(), new DtComentario(1, null,new Date(2019-1900,7,15), "
sub_1_1: mas o menos
", 1), u2);
c1
.
agregarSubComentario
(
c1
.
getId
(),
new
DtComentario
(
1
,
null
,
new
Date
(
2019
-
1900
,
7
,
15
),
"
1.2
"
,
1
),
u2
);
c1.agregarSubComentario(c1.getId(), new DtComentario(1, null,new Date(2019-1900,7,15), "
sub_1_2: mas o menos
", 1), u3);
c1
.
agregarSubComentario
(
c1
.
getId
(),
new
DtComentario
(
1
,
null
,
new
Date
(
2019
-
1900
,
7
,
15
),
"
1.3
"
,
1
),
u3
);
c1.agregarSubComentario(c1.getId(), new DtComentario(1, null,new Date(2019-1900,7,15), "
sub_1_3: mas o menos
", 1), u4);
c1
.
agregarSubComentario
(
c1
.
getId
(),
new
DtComentario
(
1
,
null
,
new
Date
(
2019
-
1900
,
7
,
15
),
"
1.4
"
,
1
),
u4
);
c1.agregarSubComentario(c1.getId(), new DtComentario(1, null,new Date(2019-1900,7,15), "sub_1_sub_1_1: mas o menos", 2), u3);
c1
.
agregarSubComentario
(
4
,
new
DtComentario
(
1
,
null
,
new
Date
(
2019
-
1900
,
7
,
15
),
"1.4.5"
,
2
),
u3
);
c1
.
agregarSubComentario
(
2
,
new
DtComentario
(
1
,
null
,
new
Date
(
2019
-
1900
,
7
,
15
),
"1.2.6"
,
2
),
u3
);
c1
.
agregarSubComentario
(
6
,
new
DtComentario
(
1
,
null
,
new
Date
(
2019
-
1900
,
7
,
15
),
"1.2.6.7"
,
2
),
u3
);
c1
.
agregarSubComentario
(
4
,
new
DtComentario
(
1
,
null
,
new
Date
(
2019
-
1900
,
7
,
15
),
"1.4.8"
,
2
),
u3
);
c1
.
agregarSubComentario
(
5
,
new
DtComentario
(
1
,
null
,
new
Date
(
2019
-
1900
,
7
,
15
),
"1.4.5.9"
,
2
),
u3
);
ArrayList
l
=
c1
.
listarSubComentarios
();
ArrayList
l
=
c1
.
listarSubComentarios
();
for
(
int
i
=
0
;
i
<
l
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
l
.
size
();
i
++){
System
.
out
.
println
(
l
.
get
(
i
).
toString
());
System
.
out
.
println
(
l
.
get
(
i
).
toString
());
}*/
ArrayList
<
Integer
>
l
=
new
ArrayList
();
l
.
add
(
2
);
l
.
add
(
8
);
l
.
add
(
15
);
l
.
add
(
22
);
l
.
add
(
7
);
for
(
int
i
=
0
;
i
<
l
.
size
();
i
++){
System
.
out
.
println
(
l
.
get
(
i
));
}
}
}
}
}
}
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