Class Range

java.lang.Object
dev.costas.javahelpers.Range

public class Range extends Object
Generate a range of numbers.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int[]
    of(int end)
    Generate a range of numbers between 0 and end with a hop of 1.
    static int[]
    of(int start, int end)
    Generate a range of numbers between start and end with a hop of 1.
    static int[]
    of(int start, int end, int step)
    Generate a range of numbers from start to end leaving a gap of step.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Range

      public Range()
  • Method Details

    • of

      public static int[] of(int start, int end, int step)
      Generate a range of numbers from start to end leaving a gap of step.
      Parameters:
      start - The start of the range.
      end - The end of the range.
      step - The gap between each number.
      Returns:
      The range of numbers.
    • of

      public static int[] of(int start, int end)
      Generate a range of numbers between start and end with a hop of 1.
      Parameters:
      start - The start of the range.
      end - The end of the range.
      Returns:
      The range of numbers.
    • of

      public static int[] of(int end)
      Generate a range of numbers between 0 and end with a hop of 1.
      Parameters:
      end - The end of the range.
      Returns:
      The range of numbers.