/** * Creates a new instance of AbstractWeighted * @param weight * The weight */ public AbstractWeighted( double weight ) { this.setWeight(weight); }
/** * Creates a shallow copy of the WeightedValue. The weight is copied but * the value is not. * * @return A new shallow copy of this {@code WeightedValue}. */ @Override public DefaultWeightedValue<ValueType> clone() { @SuppressWarnings("unchecked") final DefaultWeightedValue<ValueType> clone = (DefaultWeightedValue<ValueType>) super.clone(); clone.setValue(ObjectUtil.cloneSmart(this.getValue())); return clone; }
/** * Creates a shallow copy of the WeightedValue. The weight is copied but * the value is not. * * @return A new shallow copy of this {@code WeightedValue}. */ @Override public DefaultWeightedValue<ValueType> clone() { @SuppressWarnings("unchecked") final DefaultWeightedValue<ValueType> clone = (DefaultWeightedValue<ValueType>) super.clone(); clone.setValue(ObjectUtil.cloneSmart(this.getValue())); return clone; }
/** * Creates a new instance of AbstractWeighted * @param weight * The weight */ public AbstractWeighted( double weight ) { this.setWeight(weight); }
/** * Creates a shallow copy of the WeightedValue. The weight is copied but * the value is not. * * @return A new shallow copy of this {@code WeightedValue}. */ @Override public DefaultWeightedValue<ValueType> clone() { @SuppressWarnings("unchecked") final DefaultWeightedValue<ValueType> clone = (DefaultWeightedValue<ValueType>) super.clone(); clone.setValue(ObjectUtil.cloneSmart(this.getValue())); return clone; }
/** * Creates a new instance of AbstractWeighted * @param weight * The weight */ public AbstractWeighted( double weight ) { this.setWeight(weight); }