in scala.util
object Sorting

object Sorting
extends java.lang.Object
with scala.ScalaObject

The Sorting object provides functions that can sort various kinds of objects. You can provide a comparison function, or you can request a sort of items that are viewable as Ordered. Some sorts that operate directly on a subset of value types are also provided. These implementations are derived from those in the Sun JDK.

Note that stability doesn't matter for value types, so use the quickSort variants for those. stableSort is intended to be used with objects when the prior ordering should be preserved, where possible.

Author:
Ross Judson
Version:
1.0

Constructor Summary
def this

Def Summary
def quickSort (a: scala.Array[scala.Double]) : scala.Unit
Quickly sort an array of Doubles.
def quickSort (a: scala.Array[scala.Float]) : scala.Unit
Quickly sort an array of Floats.
def quickSort (a: scala.Array[scala.Int]) : scala.Unit
Quickly sort an array of Ints.
def quickSort [K] (a: scala.Array[K])(view$0: (K) => scala.Ordered[K]) : scala.Unit
Quickly sort an array of items that are viewable as ordered.
implicit def seq2RichSort [K <: scala.Ordered[K]] (s: scala.Seq[K]) : scala.util.RichSorting[K]
Provides implicit access to sorting on arbitrary sequences of orderable items. This doesn't quite work the way that I want yet -- K should be bounded as viewable, but the compiler rejects that.
def stableSort [K, M] (a: scala.Seq[K], f: (K) => M)(view$3: (M) => scala.Ordered[M]) : scala.Array[K]
Stably sorts a sequence of items given an extraction function that will return an ordered key from an item.
def stableSort [K] (a: scala.Array[K])(view$1: (K) => scala.Ordered[K]) : scala.Unit
Sort an array of K where K is Ordered, preserving the existing order where the values are equal.
def stableSort [K] (a: scala.Array[K], f: (K, K) => scala.Boolean) : scala.Unit
Sorts an array of K given an ordering function f. f should return true iff its first parameter is strictly less than its second parameter.
def stableSort [K] (a: scala.Seq[K])(view$2: (K) => scala.Ordered[K]) : scala.Array[K]
Sorts an arbitrary sequence of items that are viewable as ordered.
def stableSort [K] (a: scala.Seq[K], f: (K, K) => scala.Boolean) : scala.Array[K]
Sorts an arbitrary sequence into an array, given a comparison function that should return true iff parameter one is strictly less than parameter two.
Constructor Detail
def this

Def Detail
def quickSort (a: scala.Array[scala.Double]): scala.Unit
Quickly sort an array of Doubles.

def quickSort (a: scala.Array[scala.Float]): scala.Unit
Quickly sort an array of Floats.

def quickSort (a: scala.Array[scala.Int]): scala.Unit
Quickly sort an array of Ints.

def quickSort [K](a: scala.Array[K])(view$0: (K) => scala.Ordered[K]): scala.Unit
Quickly sort an array of items that are viewable as ordered.

implicit def seq2RichSort [K <: scala.Ordered[K]](s: scala.Seq[K]): scala.util.RichSorting[K]
Provides implicit access to sorting on arbitrary sequences of orderable items. This doesn't quite work the way that I want yet -- K should be bounded as viewable, but the compiler rejects that.

def stableSort [K, M](a: scala.Seq[K], f: (K) => M)(view$3: (M) => scala.Ordered[M]): scala.Array[K]
Stably sorts a sequence of items given an extraction function that will return an ordered key from an item.
Parameters:
a - the sequence to be sorted.
Parameters:
f - the comparison function.
Returns:
the sorted sequence of items.

def stableSort [K](a: scala.Array[K])(view$1: (K) => scala.Ordered[K]): scala.Unit
Sort an array of K where K is Ordered, preserving the existing order where the values are equal.

def stableSort [K](a: scala.Array[K], f: (K, K) => scala.Boolean): scala.Unit
Sorts an array of K given an ordering function f. f should return true iff its first parameter is strictly less than its second parameter.

def stableSort [K](a: scala.Seq[K])(view$2: (K) => scala.Ordered[K]): scala.Array[K]
Sorts an arbitrary sequence of items that are viewable as ordered.

def stableSort [K](a: scala.Seq[K], f: (K, K) => scala.Boolean): scala.Array[K]
Sorts an arbitrary sequence into an array, given a comparison function that should return true iff parameter one is strictly less than parameter two.
Parameters:
a - the sequence to be sorted.
Parameters:
f - the comparison function.
Returns:
the sorted sequence of items.