X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FMux.java;h=47fe164ad6fc04bc21dc94d57c09d89158e7f766;hb=f14ea37d69488dd51518a36413af7176916b8bd7;hp=bbb10f5e8db9fc5df6561b1861f4823135e4ef8e;hpb=07faf07e3acb8b2afdc2bf65a46bc868faaed0f8;p=Mograsim.git diff --git a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Mux.java b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Mux.java index bbb10f5e..47fe164a 100644 --- a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Mux.java +++ b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Mux.java @@ -41,11 +41,11 @@ public class Mux extends BasicComponent { if (inputs[i].length() != outputSize) throw new IllegalArgumentException("All MUX wire arrays must be of uniform length!"); - inputs[i].addObserver(this); + inputs[i].registerObserver(this); } this.select = select; - select.addObserver(this); + select.registerObserver(this); int maxInputs = 1 << select.length(); if (this.inputs.length > maxInputs) @@ -82,7 +82,7 @@ public class Mux extends BasicComponent @Override public List getAllInputs() { - ArrayList wires = new ArrayList(Arrays.asList(inputs)); + ArrayList wires = new ArrayList<>(Arrays.asList(inputs)); wires.add(select); return Collections.unmodifiableList(wires); }