Package fj.function
Class Booleans
java.lang.Object
fj.function.Booleans
Curried logical functions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionCurried form of logical "and" (conjunction).Curried form of logical "if" (reverse material implication).Curried form of logical "if and only if" (biconditional, equivalence).Curried form of logical "only if" (material implication).Curried form of logical "not if" (reverse nonimplication).Curried form of logical "not implies" (nonimplication).Curried form of logical "not or".Logical negation.Curried form of logical "inclusive or" (disjunction).Curried form of logical xor (nonequivalence). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Returns true if all the elements of the given list are true.static boolean
Returns true if all the elements of the given stream are true.composes the given predicate using conjunctionReturns a composed predicate of given List of predicatesReturns composed predicatecond()
Curried form of conditional.maps given function to the predicate functionalias for contramapreturns inverse of contramapNegates the given predicate.static boolean
Returns true if any element of the given list is true.static boolean
Returns true if any element of the given stream is true.returns composed predicate using disjunctionReturns a composed predicate of given List of predicatesReturns a composed predicate of given Stream of predicatescomposes the given predicate using exclusive disjunction
-
Field Details
-
or
Curried form of logical "inclusive or" (disjunction). -
and
Curried form of logical "and" (conjunction). -
xor
Curried form of logical xor (nonequivalence). -
not
Logical negation. -
implies
Curried form of logical "only if" (material implication). -
if_
Curried form of logical "if" (reverse material implication). -
iff
Curried form of logical "if and only if" (biconditional, equivalence). -
nimp
Curried form of logical "not implies" (nonimplication). -
nif
Curried form of logical "not if" (reverse nonimplication). -
nor
Curried form of logical "not or".
-
-
Constructor Details
-
Booleans
private Booleans()
-
-
Method Details
-
and
Returns true if all the elements of the given list are true.- Parameters:
l
- A list to check for all the elements being true.- Returns:
- true if all the elements of the given list are true. False otherwise.
-
contramap
maps given function to the predicate function- Parameters:
f
- functionp
- predicate to be mapped over- Returns:
- predicate function
-
is
alias for contramap- Parameters:
f
- functionp
- predicate to be mapped over- Returns:
- predicate function
-
isnot
returns inverse of contramap- Parameters:
f
- functionp
- predicate to be mapped over- Returns:
- predicate function
-
and
composes the given predicate using conjunction- Parameters:
p1
- first predicatep2
- second predicate- Returns:
- composed predicate function
-
xor
composes the given predicate using exclusive disjunction- Parameters:
p1
- first predicatep2
- second predicate- Returns:
- composed predicate function
-
or
returns composed predicate using disjunction- Parameters:
p1
- first predicatep2
- second predicate- Returns:
- composed predicate
-
and
Returns true if all the elements of the given stream are true.- Parameters:
l
- A stream to check for all the elements being true.- Returns:
- true if all the elements of the given stream are true. False otherwise.
-
andAll
Returns composed predicate- Parameters:
l
- A stream of predicates- Returns:
- composed predicate
-
andAll
Returns a composed predicate of given List of predicates- Parameters:
l
- A list of predicate functions- Returns:
- composed predicate function
-
orAll
Returns a composed predicate of given List of predicates- Parameters:
l
- A list of predicate functions- Returns:
- composed predicate function
-
orAll
Returns a composed predicate of given Stream of predicates- Parameters:
l
- A stream of predicate functions- Returns:
- composed predicate function
-
or
Returns true if any element of the given list is true.- Parameters:
l
- A list to check for any element being true.- Returns:
- true if any element of the given list is true. False otherwise.
-
or
Returns true if any element of the given stream is true.- Parameters:
l
- A stream to check for any element being true.- Returns:
- true if any element of the given stream is true. False otherwise.
-
not
Negates the given predicate.- Parameters:
p
- A predicate to negate.- Returns:
- The negation of the given predicate.
-
cond
Curried form of conditional. If the first argument is true, returns the second argument, otherwise the third argument.- Returns:
- A function that returns its second argument if the first argument is true, otherwise the third argument.
-