Mejoras de estilo y otros
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user