functional :: ComparatorWith :: f
functional :: ComparatorWith :: f=
functional $ ComparatorWith :: SELF
Type of this instance, automatically specialized in every classfunctional $ ComparatorWith :: compare
Comparea
and b
.
core :: Comparator :: bubble_sort
Bubble-sortarray
between from
and to
indices
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
core :: Comparator :: defaultinit
functional :: ComparatorWith :: f
functional :: ComparatorWith :: f=
core :: Comparator :: insertion_sort
Insertion-sortarray
between from
and to
indices
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Comparator :: merge_sort
Merge-sortarray
between from
and to
indices
core :: Object :: output_class_name
Display class name on stdout (debug only).core :: Comparator :: quick_sort
Quick-sortarray
between from
and to
indices
# Comparator that use a function provided by the user to compare between elements.
class ComparatorWith[E]
super Comparator
redef type COMPARED: E
var f: Fun1[E, Comparable]
redef fun compare(a,b)
do
var x = f.call(a)
var y = f.call(b)
if x < y then return -1
if x > y then return 1
return 0
end
end
lib/functional/iter_extras.nit:393,1--408,3