Interface RingElement<E extends RingElement<E>>
- All Known Subinterfaces:
FieldElement<E>
- All Known Implementing Classes:
Complex, Integer, NativeRealBig, Rational, Real, RealBig, RealDouble, RealFloat
public interface RingElement<E extends RingElement<E>>
Marker interface for elements of a ring structure.
A ring element supports addition, multiplication, and negation operations as instance methods. This interface uses F-bounded polymorphism (self-typing) to ensure type safety: operations return the same type as the implementing class.
Ring Axioms
Elements must satisfy:
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionReturns the sum of this element and another.default booleanisOne()Checks if this element is the multiplicative identity (one).default booleanisZero()Checks if this element is the additive identity (zero).Returns the product of this element and another.negate()Returns the additive inverse of this element.one()Returns the multiplicative identity element (one).default EReturns the difference of this element and another.zero()Returns the additive identity element (zero).
-
Method Details
-
add
-
multiply
-
negate
-
subtract
-
zero
E zero()Returns the additive identity element (zero).For any element e: e.add(e.zero()) = e
- Returns:
- the zero element
-
one
E one()Returns the multiplicative identity element (one).For any element e: e.multiply(e.one()) = e
- Returns:
- the one element
-
isZero
default boolean isZero()Checks if this element is the additive identity (zero).- Returns:
- true if this equals zero()
-
isOne
default boolean isOne()Checks if this element is the multiplicative identity (one).- Returns:
- true if this equals one()
-