Class ArithmeticalEnumerable<N,D>

java.lang.Object
org.midheaven.collections.AbstractEnumerableDecorator<N>
org.midheaven.math.ArithmeticalEnumerable<N,D>
Type Parameters:
N - type of the element being enumerated
D - type of the element resulting from dividing T by a whole number
All Implemented Interfaces:
Iterable<N>, Enumerable<N>

public class ArithmeticalEnumerable<N,D> extends AbstractEnumerableDecorator<N>
Represents Arithmetical Enumerable.
  • Constructor Details

    • ArithmeticalEnumerable

      public ArithmeticalEnumerable(Arithmetic<N,D> arithmetic, Enumerable<N> original)
      Creates a new ArithmeticalEnumerable.
      Parameters:
      arithmetic - the arithmetic value
      original - the original value
  • Method Details

    • sum

      public N sum()
      Performs sum.
      Returns:
      the result of sum
    • average

      public D average()
      Performs average.
      Returns:
      the result of average