public ISortStrategy CreateSort(SortAlgorithmEnum sortAlgorithm, SortTypeEnum sortType, IStepCounter stepCounter) { ISortType neededSortType = this.sortTypeFactory.CreateSortType(sortType); switch (sortAlgorithm) { case SortAlgorithmEnum.InsertionSort: { return(new InsertionSort(neededSortType, stepCounter)); } case SortAlgorithmEnum.MergeSort: { return(new MergeSort(neededSortType, stepCounter)); } case SortAlgorithmEnum.QuickSort: { return(new QuickSort(neededSortType, stepCounter)); } case SortAlgorithmEnum.SelectionSort: { return(new SelectionSort(neededSortType, stepCounter)); } default: return(null); } }
public void SortTypeFactory_CreateSortType_DescendingTypeValue_CreateDescendingTypeInstance() { var sortTypeFactory = new SortTypeFactory(); ISortType sortType = sortTypeFactory.CreateSortType(SortTypeEnum.Descending); Assert.IsInstanceOfType(sortType, typeof(DescendingSortType)); }
public void SetSorType(ISortType <T> type) { currentSortType = type; }
partial void SortType_SetCondition(ref ISortField instance, ref ISortType setValue);
protected override SortStrategyBase GetSortStrategy(ISortType sortType, IStepCounter stepCounter) => new QuickSort(sortType, stepCounter);
protected abstract SortStrategyBase GetSortStrategy(ISortType sortType, IStepCounter stepCounter);
public SelectionSort(ISortType sortType, IStepCounter stepCounter) : base(sortType, stepCounter) { }
public SortStrategyBase(ISortType sortType, IStepCounter stepCounter) { this.sortType = sortType ?? throw new ArgumentNullException(nameof(sortType)); this.stepCounter = stepCounter ?? throw new ArgumentNullException(nameof(stepCounter)); }
public InsertionSort(ISortType sortType, IStepCounter stepCounter) : base(sortType, stepCounter) { }
public QuickSort(ISortType sortType, IStepCounter stepCounter) : base(sortType, stepCounter) { }
public MergeSort(ISortType sortType, IStepCounter stepCounter) : base(sortType, stepCounter) { }
/// <summary> /// Inserts the specified index. /// </summary> /// <param name="index">The index.</param> /// <param name="name">The name.</param> /// <param name="sortType">Type of the sort.</param> /// <exception cref="DynCon.OSI.Core.Helpers.ToBeImplementedException"></exception> void ISortFieldList.Insert(Int32 index, String name, ISortType sortType) { throw new ToBeImplementedException(); }
/// <summary> /// Adds the specified name. /// </summary> /// <param name="name">The name.</param> /// <param name="sortType">Type of the sort.</param> /// <returns>Int32.</returns> /// <exception cref="DynCon.OSI.Core.Helpers.ToBeImplementedException"></exception> Int32 ISortFieldList.Add(String name, ISortType sortType) { throw new ToBeImplementedException(); }
public static SortType GetInstance(ISortType src) { return(default(SortType)); }