Comparison

com.phasmidsoftware.comparer.Comparison
See theComparison companion enum
object Comparison

Companion object for Comparison.

Attributes

Companion
enum
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Comparison.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply(b: Boolean): Comparison

Method to construct a Comparison from a Boolean which, as with Different, says whether the comparison is less.

Method to construct a Comparison from a Boolean which, as with Different, says whether the comparison is less.

Value parameters

b

true for Less, false for More.

Attributes

Returns

Different(b)

Method to construct a Comparison from a Kleenean (the inverse of toKleenean).

Method to construct a Comparison from a Kleenean (the inverse of toKleenean).

Value parameters

k

a Kleenean.

Attributes

Returns

More if k is Truth(true), Less if k is Truth(false), otherwise Same.

def apply(bo: Option[Boolean]): Comparison

Method to construct a Comparison from an Option[Boolean] which, as with Different, says whether the comparison is less.

Method to construct a Comparison from an Option[Boolean] which, as with Different, says whether the comparison is less.

Value parameters

bo

Some(true) for Less, Some(false) for More, None for Same.

Attributes

Returns

the corresponding Comparison.

def apply[T : Comparer](t2: T)(t1: T): Comparison

Method to construct a Comparison from two objects of type T (curried form).

Method to construct a Comparison from two objects of type T (curried form).

NOTE: the sense of the result will be similar to invoking, for example, Double.compare(t1, t2).

Type parameters

T

the type of both t1 and t2, which type must also provide a given Comparer[T].

Value parameters

t1

the outer T.

t2

the inner T.

Attributes

Returns

a Comparison, resulting from applying the comparer to t2 and its result to t1.

def convert(x: Int): Comparison

Method to construct a Comparison from a Java-style comparison result.

Method to construct a Comparison from a Java-style comparison result.

Value parameters

x

an integer which is either less than 0, equal to 0, or greater than 0. Typically, this is the result of a Java-style comparison.

Attributes

Returns

the homologous Comparison for x, either Same or Different(b) where b is true if x is negative.

Concrete fields

Different(true).

Different(true).

Attributes

Different(false).

Different(false).

Attributes