X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=era.mi%2Fsrc%2Fera%2Fmi%2Flogic%2Fwires%2FWireArray.java;fp=era.mi%2Fsrc%2Fera%2Fmi%2Flogic%2Fwires%2FWireArray.java;h=58f27bc2d0856aae3e821c16788fe2234047f207;hb=c18c04011cab0040c2287608eeefc9c3cc4536c2;hp=a0bd7f8b00cf8a53a3487bac3c6a17ab6c1170ad;hpb=18cf2f85ed378005aa93c8b88fe5fa055a108fad;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 a0bd7f8b..58f27bc2 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); + } /**