Java List Create CreateIntegerSequenceList(int startNumber, int endNumber)

Here you can find the source of CreateIntegerSequenceList(int startNumber, int endNumber)

Description

Creates a list of integers starting at one value and ending at another value (increment step is one).

License

Open Source License

Parameter

Parameter Description
startNumber Start number
endNumber End number

Return

List of Integer values

Declaration

public static ArrayList<Integer> CreateIntegerSequenceList(int startNumber, int endNumber) 

Method Source Code


//package com.java2s;
// it under the terms of the GNU General Public License as published by

import java.util.*;

public class Main {
    /** Creates a list of integers starting at one value and ending at another value (increment step is one).
     */*from ww w . j a  v a  2 s . co m*/
     * @param startNumber Start number
     * @param endNumber End number
     * @return List of Integer values
     */
    public static ArrayList<Integer> CreateIntegerSequenceList(int startNumber, int endNumber) {
        ArrayList<Integer> list = new ArrayList<Integer>();

        for (int i = startNumber; i <= endNumber; i++)
            list.add(i);

        return list;
    }
}

Related

  1. createInString(List keys)
  2. createIntArray(List coll)
  3. CreateIntArrayFromIntegerList(List solidsList)
  4. createIntegerList(int[] array)
  5. createIntegerQueryString(List values)
  6. createIntegerSetFromIntegerList(List integerList)
  7. createInterfaceContent(String typeName, @SuppressWarnings("rawtypes") List superInterfaces, String indentation, String lineSeparator)
  8. createIntListToN(int n)
  9. createKeyValPair(List lst)