X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=era.mi%2Fsrc%2Fera%2Fmi%2Flogic%2Fwires%2FWireArray.java;h=ca93fcb49866dd8ea34ecb9ec1d5322455324cd8;hb=f2cd90fa2b844507bc9697d3af1f3e18aac80b37;hp=033d1d46dab245606c900aa185d8a2e3e1bcaebd;hpb=2174689b35611c63b60f61c1e076ebb689977a6a;p=Mograsim.git diff --git a/era.mi/src/era/mi/logic/wires/WireArray.java b/era.mi/src/era/mi/logic/wires/WireArray.java index 033d1d46..ca93fcb4 100644 --- a/era.mi/src/era/mi/logic/wires/WireArray.java +++ b/era.mi/src/era/mi/logic/wires/WireArray.java @@ -22,7 +22,7 @@ public class WireArray public final int travelTime; private List observers = new ArrayList(); public final int length; - private List inputs = new ArrayList(); + List inputs = new ArrayList(); public WireArray(int length, int travelTime) { @@ -73,7 +73,7 @@ public class WireArray } } - private void recalculate() + void recalculate() { switch (inputs.size()) { @@ -223,7 +223,7 @@ public class WireArray return new WireArrayEnd(this); } - private void registerInput(WireArrayEnd toRegister) + void registerInput(WireArrayEnd toRegister) { inputs.add(toRegister); } @@ -239,9 +239,9 @@ public class WireArray { public final WireArray owner; private boolean open; - private Bit[] inputValues; + Bit[] inputValues; - private WireArrayEnd(WireArray owner) + WireArrayEnd(WireArray owner) { super(); this.owner = owner; @@ -264,12 +264,11 @@ public class WireArray */ public void feedSignals(Bit... newValues) { - if (newValues.length == length) - { - feedSignals(0, newValues); - } else + if (newValues.length != length) throw new IllegalArgumentException( String.format("Attempted to input %d bits instead of %d bits.", newValues.length, length)); + feedSignals(0, newValues); + } /**