doc: List the inner classes in the search bar.
[nit.git] / src / model_utils.nit
index 12c07e3..7af444d 100644 (file)
@@ -213,16 +213,6 @@ end
 
 redef class MClass
 
-       # Get the public owner of 'self'.
-       fun public_owner: MModule do
-               var public_owner = self.intro_mmodule.public_owner
-               if public_owner == null then
-                       return self.intro_mmodule
-               else
-                       return public_owner
-               end
-       end
-
        # Get direct parents of 'self'.
        fun parents: Set[MClass] do
                var ret = new HashSet[MClass]
@@ -427,8 +417,8 @@ redef class MClass
        # Get the list of all parameter types in 'self'.
        fun parameter_types: Map[String, MType] do
                var res = new HashMap[String, MType]
-               for i in [0..intro.parameter_names.length[ do
-                       res[intro.parameter_names[i]] = intro.bound_mtype.arguments[i]
+               for p in mparameters do
+                       res[p.name] = p
                end
                return res
        end
@@ -535,9 +525,9 @@ end
 
 # Sort mentities by their name
 class MEntityNameSorter
-       super AbstractSorter[MEntity]
+       super Comparator
+       redef type COMPARED: MEntity
        redef fun compare(a, b) do return a.name <=> b.name
-       init do end
 end
 
 # Sort MConcerns based on the module importation hierarchy ranking
@@ -545,14 +535,15 @@ end
 #
 # Comparison is made with the formula:
 #
-#     a.concern_rank + a.booster_rank <=> b.concern_rank + b.booster_ran
+# ~~~nitish
+# a.concern_rank + a.booster_rank <=> b.concern_rank + b.booster_ran
+# ~~~
 #
 # If both `a` and `b` have the same ranking,
 # ordering is based on lexicographic comparison of `a.name` and `b.name`
 class MConcernRankSorter
-       super AbstractSorter[MConcern]
-
-       init do end
+       super Comparator
+       redef type COMPARED: MConcern
 
        redef fun compare(a, b) do
                if a.concern_rank == b.concern_rank then