Class Ord<A>
java.lang.Object
fj.Ord<A>
Tests for ordering between two objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacePrimitives functions of Ord: alternative minimal definition and overridable methods.static interfacePrimitives functions of Ord: minimal definition and overridable methods.(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Ord<BigDecimal> An order instance for theBigDecimaltype.static final Ord<BigInteger> An order instance for theBigIntegertype.An order instance for thebooleantype.An order instance for thebytetype.An order instance for thechartype.private final Ord.Definition<A> An order instance for thedoubletype.An order instance for thefloattype.An order instance for theinttype.An order instance for thelongtype.A function that returns the greater of its two arguments.A function that returns the lesser of its two arguments.An order instance for theNaturaltype.An order instance for theOrderingtype.An order instance for theshorttype.static final Ord<StringBuffer> An order instance for theStringBuffertype.static final Ord<StringBuilder> An order instance for theStringBuffertype.An order instance for theStringtype.An order instance for theUnittype. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAn order instance for theArraytype.static <A extends Comparable<A>>
Ord<A> An order instance for theComparableinterface.compare()First-class ordering.Returns an ordering for the given arguments.static <A,B> Ord <A> Static version ofcontramap(F)<B> Ord<B> Maps the given function across this ord as a contra-variant functor.private static <A,B> Ord.Definition <B> contramapDef(F<B, A> f, Ord.Definition<A> def) An order instance for theEithertype.booleanReturnstrueif the given arguments are equal,falseotherwise.equal()Returns anEqualfor this order.isGreaterThan(A a) Returns a function that returns true if its argument is greater than than the argument to this method.booleanisGreaterThan(A a1, A a2) Returnstrueif the first given argument is greater than the second given argument,falseotherwise.isLessThan(A a) Returns a function that returns true if its argument is less than the argument to this method.booleanisLessThan(A a1, A a2) Returnstrueif the first given argument is less than the second given argument,falseotherwise.booleanisLessThanOrEqualTo(A a1, A a2) Returnstrueif the first given argument is less than or equal to the second given argument,falseotherwise.An order instance for theListtype.Returns the greater of its two arguments.Returns the lesser of its two arguments.static <A> Ord<NonEmptyList<A>> nonEmptyListOrd(Ord<A> oa) An order instance for theNonEmptyListtype.static <A,B> Ord.Definition <A> Begin definition of an ord instance.An order instance for theOptiontype.static <A> Ord<A> Returns an order instance that uses the given equality test and ordering function.static <A> Ord<A> Returns an order instance that uses the given equality test and ordering function.static <A> Ord<A> ordDef(Ord.AltDefinition<A> def) Returns an order instance that uses the given minimal equality test and ordering definition.static <A> Ord<A> ordDef(Ord.Definition<A> def) Returns an order instance that uses the given minimal equality test and ordering definition.An order instance for a product-1.An order instance for a product-2, with the first factor considered most significant.An order instance for a product-3, with the first factor considered most significant.reverse()Return a seq ord using the given value ord.An order instance for theSettype.An order instance for theStreamtype.static <A,B> Ord <Validation<A, B>> validationOrd(Ord<A> oa, Ord<B> ob) An order instance for theValidationtype.
-
Field Details
-
def
-
max
-
min
-
booleanOrd
-
byteOrd
-
charOrd
-
doubleOrd
-
floatOrd
-
intOrd
-
bigintOrd
An order instance for theBigIntegertype. -
bigdecimalOrd
An order instance for theBigDecimaltype. -
longOrd
-
shortOrd
-
orderingOrd
-
stringOrd
-
stringBufferOrd
An order instance for theStringBuffertype. -
stringBuilderOrd
An order instance for theStringBuffertype. -
unitOrd
-
naturalOrd
-
-
Constructor Details
-
Ord
-
-
Method Details
-
compare
-
compare
-
eq
-
equal
-
contramap
-
isLessThan
Returnstrueif the first given argument is less than the second given argument,falseotherwise.- Parameters:
a1- An instance to compare for ordering to another.a2- An instance to compare for ordering to another.- Returns:
trueif the first given argument is less than the second given argument,falseotherwise.
-
isLessThanOrEqualTo
Returnstrueif the first given argument is less than or equal to the second given argument,falseotherwise.- Parameters:
a1- An instance to compare for ordering to another.a2- An instance to compare for ordering to another.- Returns:
trueif the first given argument is less than or equal to the second given argument,falseotherwise.
-
isGreaterThan
Returnstrueif the first given argument is greater than the second given argument,falseotherwise.- Parameters:
a1- An instance to compare for ordering to another.a2- An instance to compare for ordering to another.- Returns:
trueif the first given argument is greater than the second given argument,falseotherwise.
-
isLessThan
-
isGreaterThan
-
max
-
min
-
minSemigroup
-
minMonoid
-
maxSemigroup
-
maxMonoid
-
reverse
-
on
Begin definition of an ord instance.- See Also:
-
contramap
Static version ofcontramap(F) -
contramapDef
-
ord
Returns an order instance that uses the given equality test and ordering function. Java 8+ users: useordDef(Definition)instead.- Parameters:
f- The order function.- Returns:
- An order instance.
-
ord
Returns an order instance that uses the given equality test and ordering function. Java 8+ users: useordDef(AltDefinition)instead.- Parameters:
f- The order function.- Returns:
- An order instance.
-
ordDef
Returns an order instance that uses the given minimal equality test and ordering definition.- Parameters:
def- The order definition.- Returns:
- An order instance.
-
ordDef
Returns an order instance that uses the given minimal equality test and ordering definition.- Parameters:
def- The order definition.- Returns:
- An order instance.
-
optionOrd
-
eitherOrd
-
validationOrd
An order instance for theValidationtype.- Parameters:
oa- Order across the failing side ofValidation.ob- Order across the succeeding side ofValidation.- Returns:
- An order instance for the
Validationtype.
-
listOrd
-
seqOrd
-
nonEmptyListOrd
An order instance for theNonEmptyListtype.- Parameters:
oa- Order across the elements of the non-empty list.- Returns:
- An order instance for the
NonEmptyListtype.
-
streamOrd
-
arrayOrd
-
setOrd
-
p1Ord
-
p2Ord
An order instance for a product-2, with the first factor considered most significant.- Parameters:
oa- An order instance for the first factor.ob- An order instance for the second factor.- Returns:
- An order instance for a product-2, with the first factor considered most significant.
-
p2Ord1
-
p2Ord2
-
p3Ord
An order instance for a product-3, with the first factor considered most significant.- Parameters:
oa- An order instance for the first factor.ob- An order instance for the second factor.oc- An order instance for the third factor.- Returns:
- An order instance for a product-3, with the first factor considered most significant.
-
comparableOrd
An order instance for theComparableinterface.- Returns:
- An order instance for the
Comparableinterface.
-
toComparator
-