Sorted

com.phasmidsoftware.sort.Sorted
See theSorted companion object
case class Sorted[T](ts: Seq[T])(using comparer: Comparer[T], ct: ClassTag[T]) extends () => Seq[T]

Case class Sorted to enable different types of sort on a sequence.

This is not really part of the Comparer/Comparison code and should probably not be here.

Type parameters

T

the underlying type of the sequence.

Value parameters

comparer

the Comparer[T] which determines the order.

ct

the ClassTag[T].

ts

a sequence of T values.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait () => Seq[T]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def apply(): Seq[T]

Use the system sort, based on the ordering specified by the given Comparer.

Use the system sort, based on the ordering specified by the given Comparer.

Attributes

Returns

a sorted sequence of T.

def async(using ExecutionContext): Future[Seq[T]]

Use the system sort (see apply) but the sort will be performed asynchronously.

Use the system sort (see apply) but the sort will be performed asynchronously.

Attributes

Returns

a sorted sequence of T, wrapped in Future.

def parallel(using ExecutionContext): Future[Seq[T]]

Use the parallel merge sort.

Use the parallel merge sort.

Attributes

Returns

a sorted sequence of T, wrapped in Future.

def sort(o: Comparer[T]): Sorted[T]

Method to refine the order of this Sorted, using o whenever comparer yields Same.

Method to refine the order of this Sorted, using o whenever comparer yields Same.

Value parameters

o

the Comparer[T] to use as a tie-breaker.

Attributes

Returns

a new Sorted[T].

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function0 -> Any
Inherited from:
Function0

Givens

Givens

given ordering: Ordering[T]