Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.math/PartialOrdering

PartialOrdering

scala.math.PartialOrdering
See thePartialOrdering companion object
traitPartialOrdering[T] extendsEquiv[T]

A trait for representing partial orderings. It is important to distinguish between a type that has a partial order and a representation of partial ordering on some type. This trait is for representing the latter.

Apartial ordering is a binary relation on a typeT, exposed as thelteq method of this trait. This relation must be:

- reflexive:lteq(x, x) ==true, for anyx of typeT. - anti-symmetric: iflteq(x, y) ==true andlteq(y, x) ==true thenequiv(x, y) ==true, for anyx andy of typeT. - transitive: iflteq(x, y) ==true andlteq(y, z) ==true thenlteq(x, z) ==true, for anyx,y, andz of typeT.

Additionally, a partial ordering induces anequivalence relation on a typeT:x andy of typeT are equivalent if and only iflteq(x, y) && lteq(y, x) ==true. This equivalence relation is exposed as theequiv method, inherited from theEquiv trait.

Attributes

Companion
object
Source
PartialOrdering.scala
Graph
Supertypes
traitEquiv[T]
classObject
traitMatchable
classAny
Known subtypes
traitOrdering[T]
traitNumeric[T]
traitFractional[T]
traitIntegral[T]
objectBigDecimal
objectBigInt
objectBoolean
objectByte
traitCachedReverse[T]
objectInt
objectChar
objectLong
objectShort
objectString
objectSymbol
objectUnit
Show all
Self type

Members list

Value members

Abstract methods

deflteq(x:T,y:T):Boolean

Returnstrue iffx comes beforey in the ordering.

Returnstrue iffx comes beforey in the ordering.

Attributes

Source
PartialOrdering.scala
deftryCompare(x:T,y:T):Option[Int]

Result of comparingx with operandy.

Result of comparingx with operandy. ReturnsNone if operands are not comparable. If operands are comparable, returnsSome(r) where -r < 0 iffx < y -r == 0 iffx == y -r > 0 iffx > y

Attributes

Source
PartialOrdering.scala

Concrete methods

defequiv(x:T,y:T):Boolean

Returnstrue iffx is equivalent toy in the ordering.

Returnstrue iffx is equivalent toy in the ordering.

Attributes

Source
PartialOrdering.scala
defgt(x:T,y:T):Boolean

Returnstrue iffy comes beforex in the ordering and is not the same asx.

Returnstrue iffy comes beforex in the ordering and is not the same asx.

Attributes

Source
PartialOrdering.scala
defgteq(x:T,y:T):Boolean

Returnstrue iffy comes beforex in the ordering.

Returnstrue iffy comes beforex in the ordering.

Attributes

Source
PartialOrdering.scala
deflt(x:T,y:T):Boolean

Returnstrue iffx comes beforey in the ordering and is not the same asy.

Returnstrue iffx comes beforey in the ordering and is not the same asy.

Attributes

Source
PartialOrdering.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp