Interface Addition<T>

    • Method Detail

      • add

        T add​(T a)
        Binary addition.
        Parameters:
        a - Element.
        Returns:
        this + a.
      • zero

        T zero()
        Identity element.
        Returns:
        the field element such that for all a, zero().add(a).equals(a) is true.
      • negate

        T negate()
        Additive inverse.
        Returns:
        -this.
      • isZero

        default boolean isZero()
        Check if this is a neutral element of addition, i.e. this.add(a) returns a or an element representing the same value as a.

        The default implementation calls equals(zero()). Implementations may want to employ more a efficient method. This may even be required if an implementation has multiple representations of zero and its equals method differentiates between them.

        Returns:
        true if this is a neutral element of addition.
        Since:
        1.2
        See Also:
        zero()