-public class Splitter implements WireArrayObserver
+public class Splitter implements WireObserver
{
{
- private WireArray input;
- private WireArray[] outputs;
-
- public Splitter(WireArray input, WireArray... outputs)
+ private WireEnd input;
+ private WireEnd[] outputs;
+
+ public Splitter(WireEnd input, WireEnd... outputs)
{
this.input = input;
this.outputs = outputs;
input.addObserver(this);
int length = 0;
{
this.input = input;
this.outputs = outputs;
input.addObserver(this);
int length = 0;
- for(WireArray out : outputs)
+ for (WireEnd out : outputs)
length += out.length();
length += out.length();
-
- if(input.length() != length)
- throw new IllegalArgumentException("The input of splitting one into n WireArrays must have length = a1.length() + a2.length() + ... + an.length().");
+
+ if (input.length() != length)
+ throw new IllegalArgumentException(
+ "The input of splitting one into n WireArrays must have length = a1.length() + a2.length() + ... + an.length().");