/** * Checks whether the {@link Operator} {@link Class} that of the given {@link Operator}. TODO * * @param operator that should be matched with * @return whether this instance and the {@code operator} match */ private boolean matchSlots(Operator operator) { // Check whether the InputSlots match. int inputIndex; for (inputIndex = 0; inputIndex < this.getNumInputs(); inputIndex++) { InputSlot<?> slotPattern = this.getInput(inputIndex); final InputSlot<?> testSlot = operator.getInput(slotPattern.getIndex()); if (!this.matchSlot(slotPattern, testSlot)) { return false; } } // Take special care for broadcasts. for (; inputIndex < operator.getNumInputs(); inputIndex++) { if (operator.getInput(inputIndex).isBroadcast() && !this.isAllowBroadcasts) return false; } // Check whether the OutputSlots match. for (int outputIndex = 0; outputIndex < this.getNumOutputs(); outputIndex++) { OutputSlot<?> slotPattern = this.getOutput(outputIndex); final OutputSlot<?> testSlot = operator.getOutput(slotPattern.getIndex()); if (!this.matchSlot(slotPattern, testSlot)) { return false; } } return true; }