Java Number Range Create range(long start, long end)

Here you can find the source of range(long start, long end)

Description

range

License

LGPL

Declaration

public static long[] range(long start, long end) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static long[] range(long start, long end) {
        long[] values = new long[(int) Math.abs(end - start) + 1];

        if (end < start) {
            long oldstart = start;
            start = end;//from  www. j  a v  a  2s. c om
            end = oldstart;
        }

        for (long i = start; i <= end; i++) {
            values[(int) (i - start)] = i;
        }

        return values;
    }
}

Related

  1. range(int unit)
  2. range(int v, int min, int max)
  3. range(int value, int min, int max)
  4. range(Integer from, Integer to)
  5. range(long array[])
  6. range(String field, int start, int end)
  7. range(String input[], int beginIndex, int endIndex)
  8. range(String second, String first)
  9. range(T val, T min, T max)