/// <summary> /// Creates a new object that is a copy of the current instance. /// </summary> /// <returns> /// A new object that is a copy of this instance. /// </returns> public object Clone() { bagOfWords output = new bagOfWords(); foreach (var pair in items) { output.Add(pair.Key, pair.Value); } return(output); }
/// <summary> /// Calculates the specified second. /// </summary> /// <param name="second">The second.</param> /// <param name="op">The op.</param> public void calculate(bagOfWords second, operation op) { switch (op) { case operation.assign: Clear(); AddInstanceRange(second); break; case operation.plus: AddInstanceRange(second); break; case operation.minus: Remove(second); break; default: break; } }