X-Git-Url: https://git.llucax.com/z.facultad/75.62/c2tp1.git/blobdiff_plain/f9ae0eb22d1b5e8b12030d43c77c634c81743e73..1783765ce04f5c11287a21a23956351f39fc95a7:/src/Fraccion.java?ds=sidebyside diff --git a/src/Fraccion.java b/src/Fraccion.java index 8bd3ec4..33111f0 100644 --- a/src/Fraccion.java +++ b/src/Fraccion.java @@ -1,5 +1,6 @@ +import java.util.*; -public class Fraccion implements OperFrac, ComparaFrac { +public class Fraccion extends Observable implements OperFrac, ComparaFrac { private int num; private int den; @@ -14,10 +15,14 @@ public class Fraccion implements OperFrac, ComparaFrac { public void setNum(int n) { num = n; + setChanged (); + notifyObservers (); } public void setDen(int d) { den = d; + setChanged (); + notifyObservers (); } public Fraccion() { @@ -86,6 +91,8 @@ public class Fraccion implements OperFrac, ComparaFrac { int d = mcd(getNum(), getDen()); setNum(getNum() / d); setDen(getDen() / d); + setChanged (); + notifyObservers (); } }