public WireArray(int length, int travelTime)\r
{\r
if (length < 1)\r
- throw new IllegalArgumentException(String.format("Tried to create an array of wires with length %o, but a length of less than 1 makes no sense.", length));\r
+ throw new IllegalArgumentException(String.format("Tried to create an array of wires with length %d, but a length of less than 1 makes no sense.", length));\r
this.length = length;\r
this.travelTime = travelTime;\r
initValues();\r
WireArrayInput input = inputs.get(0);\r
if (!Arrays.equals(input.getValues(), values))\r
{\r
+ Bit[] oldValues = values.clone();\r
System.arraycopy(input.getValues(), 0, values, 0, length);\r
- notifyObservers();\r
+ notifyObservers(oldValues);\r
}\r
}\r
\r
\r
if (!Arrays.equals(newValues, values))\r
{\r
- notifyObservers();\r
+ Bit[] oldValues = values;\r
values = newValues;\r
+ notifyObservers(oldValues);\r
}\r
}\r
\r
return observers.add(ob);\r
}\r
\r
- private void notifyObservers()\r
+ private void notifyObservers(Bit[] oldValues)\r
{\r
for (WireArrayObserver o : observers)\r
- o.update(this);\r
+ o.update(this, oldValues);\r
}\r
\r
/**\r