Final, todo aprobado
This commit is contained in:
@@ -9,6 +9,7 @@ public class Gestion implements Serializable{
|
||||
private float total;
|
||||
private boolean isPositivo;
|
||||
private String nombre;
|
||||
private boolean isModified;
|
||||
|
||||
/**
|
||||
* Constructor principal de gestion
|
||||
@@ -22,6 +23,7 @@ public class Gestion implements Serializable{
|
||||
this.total = 0;
|
||||
this.nombre = nombre;
|
||||
this.isPositivo = isPositivo;
|
||||
this.isModified = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,6 +37,7 @@ public class Gestion implements Serializable{
|
||||
|
||||
public void setNombre(String nombre) {
|
||||
this.nombre = nombre;
|
||||
this.isModified = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,6 +96,12 @@ public class Gestion implements Serializable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Permite editar una transaccion por nombre para cambiarselo
|
||||
*
|
||||
* @param nombreViejo nombre de la transaccion a cambiar
|
||||
* @param nombreNuevo nuevo nombre
|
||||
*/
|
||||
public void editarTransaccion(String nombreViejo, String nombreNuevo) {
|
||||
for(Transaccion elemento:this.gestiones) {
|
||||
if(elemento.getNombre().equals(nombreViejo)) {
|
||||
@@ -102,6 +111,12 @@ public class Gestion implements Serializable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Edita la fecha de una transaccion dada su fecha
|
||||
*
|
||||
* @param nombreViejo nombre de la trasnaccion a editar
|
||||
* @param fecha nueva fecha
|
||||
*/
|
||||
public void editarTransaccionFecha(String nombreViejo, LocalDate fecha) {
|
||||
for(Transaccion elemento:this.gestiones) {
|
||||
if(elemento.getNombre().equals(nombreViejo)) {
|
||||
@@ -111,6 +126,12 @@ public class Gestion implements Serializable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Edita la transaccion con el nombre indicado alterando el dinero que cuesta
|
||||
*
|
||||
* @param nombreViejo nombre de la transaccion a editar
|
||||
* @param dinero nueva cantidad de dinero;
|
||||
*/
|
||||
public void editarTransaccionDiero(String nombreViejo, float dinero) {
|
||||
for(Transaccion elemento:this.gestiones) {
|
||||
if(elemento.getNombre().equals(nombreViejo)) {
|
||||
@@ -153,9 +174,7 @@ public class Gestion implements Serializable{
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
String ret = "";
|
||||
ret += this.nombre + " " + this.suma + " " + this.isPositivo;
|
||||
return ret;
|
||||
return this.nombre + " " + this.suma + " Gastos:" + this.isPositivo + " Modificado:"+ this.isModified;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user