Esempio n. 1
0
 static void CheckOwner(IExternalMergeSortOwner <T> owner)
 {
     if (owner.InputFile == null || owner.TemporaryFile == null || owner.OutputFile == null || owner.InputFileSize < 0 || owner.BufferSize <= 0)
     {
         throw new ArgumentException();
     }
 }
Esempio n. 2
0
 public ExternalMergeSort(IExternalMergeSortOwner <T> owner, Comparison <T> comparison, ISort sorter)
 {
     Guard.IsNotNull(owner, nameof(owner));
     Guard.IsNotNull(comparison, nameof(comparison));
     Guard.IsNotNull(sorter, nameof(sorter));
     CheckOwner(owner);
     this.owner      = owner;
     this.comparison = comparison;
     this.sorter     = sorter;
 }
Esempio n. 3
0
 public ExternalMergeSort(IExternalMergeSortOwner <T> owner, Comparison <T> comparison)
     : this(owner, comparison, new MergeSorter())
 {
 }
Esempio n. 4
0
 public ExternalMergeSort(IExternalMergeSortOwner <T> owner, ISort sorter)
     : this(owner, ComparisonCore.Compare, sorter)
 {
 }
Esempio n. 5
0
 public ExternalMergeSort(IExternalMergeSortOwner <T> owner)
     : this(owner, ComparisonCore.Compare, new MergeSorter())
 {
 }