model_utils: add MEntityNameSorter
authorAlexandre Terrasa <alexandre@moz-code.org>
Wed, 18 Jun 2014 18:24:51 +0000 (14:24 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 26 Jun 2014 16:01:58 +0000 (12:01 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/model_utils.nit

index be3fd4d..f98e90e 100644 (file)
@@ -462,6 +462,13 @@ end
 
 # Sorters
 
+# Sort mentities by their name
+class MEntityNameSorter
+       super AbstractSorter[MEntity]
+       redef fun compare(a, b) do return a.name <=> b.name
+       init do end
+end
+
 # Sort mmodules by their name
 class MModuleNameSorter
        super AbstractSorter[MModule]