X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=era.mi%2Fsrc%2Fera%2Fmi%2Flogic%2Fcomponents%2Fgates%2FNotGate.java;h=685bc2290de7b5404ac4b666cc3569b2b05c1bb5;hb=6c67a9ff8361cd9fc082f40e2676f2c8b5911fe4;hp=f65a174c4ef4c6d8ebbdde2bee5d7e9db42d733f;hpb=c1d0ddc342c482051fa6c455bb286617135bd3c3;p=Mograsim.git diff --git a/era.mi/src/era/mi/logic/components/gates/NotGate.java b/era.mi/src/era/mi/logic/components/gates/NotGate.java index f65a174c..685bc229 100644 --- a/era.mi/src/era/mi/logic/components/gates/NotGate.java +++ b/era.mi/src/era/mi/logic/components/gates/NotGate.java @@ -1,21 +1,20 @@ package era.mi.logic.components.gates; -import java.util.Arrays; -import java.util.Collections; import java.util.List; -import era.mi.logic.Util; import era.mi.logic.components.BasicComponent; -import era.mi.logic.wires.Wire.WireEnd; +import era.mi.logic.timeline.Timeline; +import era.mi.logic.wires.Wire.ReadEnd; +import era.mi.logic.wires.Wire.ReadWriteEnd; public class NotGate extends BasicComponent { - private WireEnd in; - private WireEnd out; + private ReadEnd in; + private ReadWriteEnd out; - public NotGate(int processTime, WireEnd in, WireEnd out) + public NotGate(Timeline timeline, int processTime, ReadEnd in, ReadWriteEnd out) { - super(processTime); + super(timeline, processTime); this.in = in; in.addObserver(this); this.out = out; @@ -24,28 +23,28 @@ public class NotGate extends BasicComponent @Override protected void compute() { - out.feedSignals(Util.not(in.getValues())); + out.feedSignals(in.getValues().not()); } - public WireEnd getIn() + public ReadEnd getIn() { return in; } - public WireEnd getOut() + public ReadEnd getOut() { return out; } @Override - public List getAllInputs() + public List getAllInputs() { - return Collections.unmodifiableList(Arrays.asList(in)); + return List.of(in); } @Override - public List getAllOutputs() + public List getAllOutputs() { - return Collections.unmodifiableList(Arrays.asList(out)); + return List.of(out); } }