Mejoras de estilo y otros

This commit is contained in:
roche
2019-11-14 12:05:58 +01:00
parent 0ade46bde2
commit 667182d76e
13 changed files with 126 additions and 109 deletions

View File

@@ -13,15 +13,15 @@ public class Gestion{
public Gestion() {
this.gestiones=new Vector<Transaccion>();
this.suma=0;
Gestion.total=0;
this.suma = 0;
Gestion.total = 0;
}
public Gestion(String nombre) {
this.gestiones=new Vector<Transaccion>();
this.suma=0;
Gestion.total=0;
this.nombre=nombre;
this.gestiones = new Vector<Transaccion>();
this.suma = 0;
Gestion.total = 0;
this.nombre = nombre;
}
public String getNombre() {
@@ -30,11 +30,11 @@ public class Gestion{
public void aniadirGasto(Transaccion transaccion) {
this.gestiones.add(transaccion);
this.suma+=transaccion.getDinero();
this.suma += transaccion.getDinero();
if(transaccion.isPositivo()) {
Gestion.total+=transaccion.getDinero();
Gestion.total += transaccion.getDinero();
}else {
Gestion.total-=transaccion.getDinero();
Gestion.total -= transaccion.getDinero();
}
}
@@ -52,18 +52,18 @@ public class Gestion{
public void alterarVisibilidad(int elemento) {
if(this.gestiones.get(elemento).alterarVisivilidad()) {
this.suma+=this.gestiones.get(elemento).getDinero();
this.suma += this.gestiones.get(elemento).getDinero();
if(this.gestiones.get(elemento).isPositivo()) {
Gestion.total+=this.gestiones.get(elemento).getDinero();
Gestion.total += this.gestiones.get(elemento).getDinero();
}else {
Gestion.total-=this.gestiones.get(elemento).getDinero();
Gestion.total -= this.gestiones.get(elemento).getDinero();
}
}else {
this.suma-=this.gestiones.get(elemento).getDinero();
this.suma -= this.gestiones.get(elemento).getDinero();
if(this.gestiones.get(elemento).isPositivo()) {
Gestion.total-=this.gestiones.get(elemento).getDinero();
Gestion.total -= this.gestiones.get(elemento).getDinero();
}else {
Gestion.total+=this.gestiones.get(elemento).getDinero();
Gestion.total += this.gestiones.get(elemento).getDinero();
}
}
}