/// <summary> /// Removes the <see cref="IIterationStopCriterium{T}"/> from the internal collection. /// </summary> /// <param name="stopCriterium">The stop criterium that must be removed.</param> public void Remove(IIterationStopCriterium <float> stopCriterium) { if (stopCriterium == null) { throw new ArgumentNullException("stopCriterium"); } if (!_stopCriterias.ContainsKey(stopCriterium.GetType())) { return; } // Remove from the collection _stopCriterias.Remove(stopCriterium.GetType()); }
/// <summary> /// Adds an <see cref="IIterationStopCriterium{T}"/> to the internal collection of stop-criteria. Only a /// single stop criterium of each type can be stored. /// </summary> /// <param name="stopCriterium">The stop criterium to add.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="stopCriterium"/> is <see langword="null" />.</exception> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="stopCriterium"/> is of the same type as an already /// stored criterium. /// </exception> public void Add(IIterationStopCriterium <float> stopCriterium) { if (stopCriterium == null) { throw new ArgumentNullException("stopCriterium"); } if (_stopCriterias.ContainsKey(stopCriterium.GetType())) { throw new ArgumentException(Resources.StopCriteriumDuplicate); } // Store the stop criterium. _stopCriterias.Add(stopCriterium.GetType(), stopCriterium); }
/// <summary> /// Indicates if the specific stop criterium is stored by the <see cref="IIterator{T}"/>. /// </summary> /// <param name="stopCriterium">The stop criterium.</param> /// <returns><c>true</c> if the <see cref="IIterator{T}"/> contains the stop criterium; otherwise <c>false</c>.</returns> public bool Contains(IIterationStopCriterium <float> stopCriterium) { return(stopCriterium != null && _stopCriterias.ContainsKey(stopCriterium.GetType())); }
/// <summary> /// Removes the <see cref="IIterationStopCriterium"/> from the internal collection. /// </summary> /// <param name="stopCriterium">The stop criterium that must be removed.</param> public void Remove(IIterationStopCriterium stopCriterium) { if (stopCriterium == null) { throw new ArgumentNullException("stopCriterium"); } if (!_stopCriterias.ContainsKey(stopCriterium.GetType())) { return; } // Remove from the collection _stopCriterias.Remove(stopCriterium.GetType()); }
/// <summary> /// Indicates if the specific stop criterium is stored by the <see cref="IIterator"/>. /// </summary> /// <param name="stopCriterium">The stop criterium.</param> /// <returns><c>true</c> if the <see cref="IIterator"/> contains the stop criterium; otherwise <c>false</c>.</returns> public bool Contains(IIterationStopCriterium stopCriterium) { return stopCriterium != null && _stopCriterias.ContainsKey(stopCriterium.GetType()); }
/// <summary> /// Adds an <see cref="IIterationStopCriterium"/> to the internal collection of stop-criteria. Only a /// single stop criterium of each type can be stored. /// </summary> /// <param name="stopCriterium">The stop criterium to add.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="stopCriterium"/> is <see langword="null" />.</exception> /// <exception cref="ArgumentException"> /// Thrown if <paramref name="stopCriterium"/> is of the same type as an already /// stored criterium. /// </exception> public void Add(IIterationStopCriterium stopCriterium) { if (stopCriterium == null) { throw new ArgumentNullException("stopCriterium"); } if (_stopCriterias.ContainsKey(stopCriterium.GetType())) { throw new ArgumentException(Resources.StopCriteriumDuplicate); } // Store the stop criterium. _stopCriterias.Add(stopCriterium.GetType(), stopCriterium); }