/** * Create a arithmetic dynamic operand that operates upon the selector names * given by the supplied dynamic operand(s). * * @param operand * the operand defining the selector names */ protected DynamicOperand(DynamicOperand operand) { this(operand.getSelectorNames()); }
/** * Create a arithmetic dynamic operand that operates upon the selector names * given by the supplied dynamic operand(s). * * @param operands * the operands defining the selector names */ protected DynamicOperand(DynamicOperand... operands) { Validate.noNullElements(operands, "The operands argument may not be null"); Set<SelectorName> names = new LinkedHashSet<SelectorName>(); for (DynamicOperand operand : operands) { names.addAll(operand.getSelectorNames()); } this.selectorNames = Collections.unmodifiableSet(names); this.hcode = new HashCodeBuilder() .append(selectorNames) .toHashCode(); }
/** * Create a arithmetic dynamic operand that operates upon the selector names * given by the supplied dynamic operand(s). * * @param operands * the operands defining the selector names */ protected DynamicOperand(Iterable<? extends DynamicOperand> operands) { Validate.notNull(operands, "The operands argument may not be null"); if (operands == null) { throw new IllegalArgumentException("operands shoud not be null"); } Set<SelectorName> names = new LinkedHashSet<SelectorName>(); for (DynamicOperand operand : operands) { Validate.notNull(operand, "The operand argument may not be null"); names.addAll(operand.getSelectorNames()); } this.selectorNames = Collections.unmodifiableSet(names); this.hcode = new HashCodeBuilder() .append(selectorNames) .toHashCode(); }