functional :: OrderedIter :: defaultinit
functional :: OrderedIter :: f
functional :: OrderedIter :: f=
functional $ OrderedIter :: SELF
Type of this instance, automatically specialized in every classfunctional $ OrderedIter :: init
functional :: OrderedIter :: defaultinit
functional :: OrderedIter :: f
functional :: OrderedIter :: f=
# An iterator that yield each item in order
class OrderedIter[E]
super FunIter[E,E]
var f: Fun1[E, Comparable]
private var sorted_iter: Iterator[E] is noinit
private var sorted_arr: Array[E] is noinit
redef init
do
sorted_arr = my_iter.to_a
sorted_arr.sort_with(f)
sorted_iter = sorted_arr.iterator
end
redef fun next
do
sorted_iter.next
end
redef fun item
do
return sorted_iter.item
end
redef fun is_ok
do
return sorted_iter.is_ok
end
redef fun finish
do
sorted_iter.finish
end
redef fun to_a
do
return sorted_arr
end
end
lib/functional/iter_extras.nit:352,1--391,3