Class Boolean
java.lang.Object
org.episteme.core.mathematics.numbers.integers.Boolean
- All Implemented Interfaces:
Comparable<Boolean>, Iterable<Boolean>, AbelianMonoid<Boolean>, Magma<Boolean>, Monoid<Boolean>, Lattice<Boolean>, Semiring<Boolean>, FiniteSet<Boolean>, Set<Boolean>
public final class Boolean
extends Object
implements Semiring<Boolean>, Lattice<Boolean>, FiniteSet<Boolean>, Comparable<Boolean>
Boolean algebraic type - matches Real/Integer pattern.
Uses singleton pattern + instance methods (like Real). Fastest implementation: singletons + primitive operations.
* @author Silvere Martin-Michiellot- Since:
- 1.0
- Author:
- Gemini AI (Google DeepMind)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the sum of two elements (additive notation).booleanintbooleanTests whether this set contains the specified element.Returns a human-readable description of this set.booleaninthashCode()booleanisEmpty()Returnstrueif this set contains no elements.booleanTests whether multiplication is commutative in this semiring.iterator()Returns an iterator over the elements in this set.The join operation (∨, least upper bound).The meet operation (∧, greatest lower bound).Returns the product of two elements.not()static Booleanof(boolean value) one()Returns the multiplicative identity (one element).Performs the binary operation on two elements.longsize()Returns the number of elements in this set (its cardinality).toString()zero()Returns the additive identity (zero element).Methods inherited from interface AbelianMonoid
identity, isCommutativeMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Monoid
isAssociative
-
Field Details
-
TRUE
-
FALSE
-
-
Method Details
-
of
-
booleanValue
public boolean booleanValue() -
add
-
multiply
-
not
-
xor
-
add
Description copied from interface:AbelianMonoidReturns the sum of two elements (additive notation).Delegates to
Magma.operate(Object, Object).- Specified by:
addin interfaceAbelianMonoid<Boolean>- Parameters:
a- the first addendb- the second addend- Returns:
- a + b
-
zero
Description copied from interface:AbelianMonoidReturns the additive identity (zero element).Delegates to
AbelianMonoid.identity().- Specified by:
zeroin interfaceAbelianMonoid<Boolean>- Returns:
- the zero element
-
multiply
Description copied from interface:SemiringReturns the product of two elements.Multiplication must be associative and distribute over addition.
-
one
-
isMultiplicationCommutative
public boolean isMultiplicationCommutative()Description copied from interface:SemiringTests whether multiplication is commutative in this semiring.- Specified by:
isMultiplicationCommutativein interfaceSemiring<Boolean>- Returns:
trueif multiplication commutes
-
join
-
meet
-
contains
Description copied from interface:SetTests whether this set contains the specified element.This is the fundamental operation of a set - membership testing.
-
size
-
iterator
-
isEmpty
public boolean isEmpty()Description copied from interface:SetReturnstrueif this set contains no elements.The empty set (∅) is a fundamental concept in set theory. It is the unique set containing no elements.
-
description
Description copied from interface:SetReturns a human-readable description of this set.Examples:
- "â„ (Real Numbers)"
- "ℤ/12ℤ (Integers modulo 12)"
- "{1, 2, 3, 4, 5}"
- Specified by:
descriptionin interfaceSet<Boolean>- Returns:
- a description of this set
-
operate
Description copied from interface:MagmaPerforms the binary operation on two elements.This is the fundamental operation of a magma. The result must be an element of this magma (closure property).
Properties: None required (not necessarily associative or commutative)
-
compareTo
- Specified by:
compareToin interfaceComparable<Boolean>
-
equals
-
hashCode
-
toString
-