Skip to content
Snippets Groups Projects
Commit 92fa5410 authored by JotaJota96's avatar JotaJota96
Browse files

clase Valoracion terminada (falta test)

parent 7352b7d6
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,11 @@ package Logica.Clases;
import Logica.DataType.DtComentario;
import java.sql.Date;
import java.util.ArrayList;
public class Comentario {
private static int contadorComentarios = 1;
private int id;
private Date fecha;
private String texto;
......@@ -21,6 +24,10 @@ public class Comentario {
this.usr = usr;
}
public static int getNuevoID(){
return contadorComentarios++;
}
public int getId() {
return id;
}
......@@ -59,18 +66,21 @@ public class Comentario {
public void setUsr(Usuario usr) {
this.usr = usr;
}/*
public boolean agregarSubComentario(int x, DtComentario dtC, Usuario usr){
}
public boolean agregarSubComentario(int idComPadre, DtComentario dtC, Usuario usr){
return true;
}
public DtComentario getDT(){
DtComentario dtC = new DtComentario(this.id, usr.getNickname, this.fecha, this.texto, this.nivelSubComentario);
DtComentario dtC = new DtComentario(this.id, this.usr.getNickname(), this.fecha, this.texto, this.nivelSubComentario);
return dtC;
}
public boolean agregarSubComentario(int x, DtComentario dtC, Usuario usr){
public ArrayList<DtComentario> listarSubComentarios(){
return new ArrayList();
}
*/
}
......@@ -29,21 +29,28 @@ public class Valoracion {
public void setUsr(Usuario usr) {
this.usr = usr;
}/*
}
private DtValoracion getDT(){
DtValoracion dtV = new DtValoracion(this.val, this.usr.getNickname());
return dtV;
}
private DtValoracion getDT(String nickname){
//faltan cosas-------------------------
DtValoracion dtV = new DtValoracion();
return dtV;
// si esta valoracion corresponde al usuario, devuelve su DT, sino null
if (nickname.equals(this.usr.getNickname())){
return this.getDT();
}else{
return null;
}
}
private boolean modificar(DtValoracion dtV, String nickname){
bolean b;
//faltan cosas-------------------------
return b;
if (nickname.equals(this.usr.getNickname())){
this.val = dtV.getVal();
return true;
}else{
return false;
}
}
*/
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment