Пример #1
0
                protected override int CompareSpecific(ComparisonKey that, ComparisonLevel level)
                {
                    var thisMz = ((PrecursorLibraryKey)LibraryKey).Mz;
                    var thatMz = ((PrecursorLibraryKey)that.LibraryKey).Mz;

                    return(thisMz.CompareTo(thatMz));
                }
Пример #2
0
                protected override int CompareSpecific(ComparisonKey that, ComparisonLevel level)
                {
                    var thisPreferredKey = ((MoleculeLibraryKey)LibraryKey).PreferredKey;
                    var thatPreferredKey = ((MoleculeLibraryKey)that.LibraryKey).PreferredKey;

                    return(string.CompareOrdinal(thisPreferredKey, thatPreferredKey));
                }
Пример #3
0
                protected override int CompareSpecific(ComparisonKey other, ComparisonLevel level)
                {
                    var that   = (Peptide)other;
                    int result = StringComparer.Ordinal.Compare(PeptideLibraryKey.UnmodifiedSequence, that.PeptideLibraryKey.UnmodifiedSequence);

                    if (result != 0 || level <= ComparisonLevel.UnmodifiedSequence)
                    {
                        return(result);
                    }
                    result = CompareModificationIndexes(that);
                    if (result != 0 || level <= ComparisonLevel.PrecisionIndependentModifications)
                    {
                        return(result);
                    }
                    return(result);
                }
Пример #4
0
            public int Compare(ComparisonKey that, ComparisonLevel level)
            {
                int result = KeyType.CompareTo(that.KeyType);

                if (result != 0 || level <= ComparisonLevel.KeyType)
                {
                    return(result);
                }
                result = CompareSpecific(that, level);
                if (result != 0 || level < ComparisonLevel.Adduct)
                {
                    return(result);
                }
                result = Adduct.CompareTo(that.Adduct);
                if (result != 0 || level <= ComparisonLevel.Adduct)
                {
                    return(result);
                }
                return(result);
            }
Пример #5
0
 /// <summary>
 /// Compares the portion of the key which is specific to the type of LibraryKey.
 /// </summary>
 protected virtual int CompareSpecific(ComparisonKey other, ComparisonLevel level)
 {
     return(0);
 }
Пример #6
0
 private static Comparer <ComparisonKey> MakeComparer(ComparisonLevel comparisonLevel)
 {
     return(Comparer <ComparisonKey> .Create((key1, key2) => key1.Compare(key2, comparisonLevel)));
 }
Пример #7
0
 private RangeList SearchEntries(ComparisonKey comparisonKey, ComparisonLevel level)
 {
     return(new RangeList(CollectionUtil.BinarySearch(_allEntries, item => item.Key.Compare(comparisonKey, level))));
 }
Пример #8
0
 protected RangeList SearchEntries(LibraryKey libraryKey, ComparisonLevel level)
 {
     return(SearchEntries(ComparisonKey.Get(libraryKey), level));
 }