Class IntegerAddition

java.lang.Object
org.zfcj.math.numbers.IntegerAddition
All Implemented Interfaces:
org.zfcj.math.set.BiFunction<Integer,Integer,Integer>, org.zfcj.math.set.BinaryOperator<Integer>

public class IntegerAddition extends Object implements org.zfcj.math.set.BinaryOperator<Integer>
A BinaryOperator that adds two Integers and returns the sum
  • Constructor Details

    • IntegerAddition

      public IntegerAddition()
  • Method Details

    • apply

      public Integer apply(Integer i, Integer j)
      Description copied from interface: org.zfcj.math.set.BiFunction
      Applies the function to the given input elements t and u and returns the corresponding output element
      Specified by:
      apply in interface org.zfcj.math.set.BiFunction<Integer,Integer,Integer>
      Parameters:
      i - an element of the first set
      j - an element of the second set
    • calculate

      public static Integer calculate(Integer i, Integer j)
      Adds the given Integers and returns their sum
      Parameters:
      i - the first integer
      j - the second integer
      Returns:
      the sum of the given integers
    • calculate

      public static NaturalNumber calculate(NaturalNumber i, NaturalNumber j)
      Adds the given NaturalNumbers and returns the result
      Parameters:
      i - the first natural number
      j - the second natural number
      Returns:
      the sum of the given natural numbers
    • calculate

      public static PositiveInteger calculate(PositiveInteger i, PositiveInteger j)
      Adds the given PositiveIntegers and returns the result
      Parameters:
      i - the first positive integer
      j - the second positive integer
      Returns:
      the sum of the given natural positive integer