public void AddOrUpdate(ProcessedPeak <I> processedPeak) { if (_peaks.TryGetValue(processedPeak.Source.GetHashCode(), out ProcessedPeak <I> oldValue)) { if (_replicateType == ReplicateType.Biological) { if ((oldValue.Classification.Contains(Attributes.Discarded) && processedPeak.Classification.Contains(Attributes.Confirmed)) || (!oldValue.Classification.Contains(Attributes.Confirmed) && !oldValue.Classification.Contains(Attributes.Discarded))) { _peaks[processedPeak.Source.GetHashCode()] = processedPeak; } } else { if (oldValue.Classification.Contains(Attributes.Confirmed) && processedPeak.Classification.Contains(Attributes.Discarded) || (!oldValue.Classification.Contains(Attributes.Confirmed) && !oldValue.Classification.Contains(Attributes.Discarded))) { _peaks[processedPeak.Source.GetHashCode()] = processedPeak; } } } else { _peaks.Add(processedPeak.Source.GetHashCode(), processedPeak); } }
public int CompareTo(ProcessedPeak <I> other) { if (other == null) { return(1); } return(base.CompareTo(other)); }