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(); } }
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; }
public ExternalMergeSort(IExternalMergeSortOwner <T> owner, Comparison <T> comparison) : this(owner, comparison, new MergeSorter()) { }
public ExternalMergeSort(IExternalMergeSortOwner <T> owner, ISort sorter) : this(owner, ComparisonCore.Compare, sorter) { }
public ExternalMergeSort(IExternalMergeSortOwner <T> owner) : this(owner, ComparisonCore.Compare, new MergeSorter()) { }