Design Pattern Examples
Overview of object-oriented design patterns
strategy_isortentries.py
Go to the documentation of this file.
8
9from abc import ABC, abstractmethod
10from enum import Enum
11
12from .strategy_entryinformation import EntryInformation
13
14
15
16class SortOptions(Enum):
17
18
19 ByName = 0
20
21
22 ByAge = 1
23
24
25 ByHeight = 2
26
27
28
30
31
32
33class ISortEntries(ABC):
34
35
39 @abstractmethod
40 def Sort(self, entries : list[EntryInformation]) -> None:
41 pass
42
43
47 @abstractmethod
48 def ToString(self) -> str:
49 pass
50
str ToString(self)
Return a string representation of the sorting strategy.
None Sort(self, list[EntryInformation] entries)
Sort the specified list of entries in place.
Identifies the different sorting strategies available.