Class Divisor

java.lang.Object
xyz.gmitch215.socketmc.util.math.Divisor
All Implemented Interfaces:
Iterator<Integer>

public final class Divisor extends Object implements Iterator<Integer>
An Integer Iterator through a division operation.
  • Constructor Details

    • Divisor

      public Divisor(int numerator, int denominator)
      Creates a new divisor for the given numerator and denominator.
      Parameters:
      numerator - The numerator
      denominator - The denominator
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<Integer>
    • next

      public Integer next()
      Specified by:
      next in interface Iterator<Integer>
    • asIterable

      public static Iterable<Integer> asIterable(int numerator, int denominator)
      Returns an iterable for the division of the numerator and denominator.
      Parameters:
      numerator - The numerator
      denominator - The denominator
      Returns:
      An iterable for the division of the numerator and denominator