Android List Search isIntListContinous(List list)

Here you can find the source of isIntListContinous(List list)

Description

is Int List Continous

Declaration

public static boolean isIntListContinous(List<Integer> list) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    public static boolean isIntListContinous(List<Integer> list) {
        if (list.isEmpty())
            return true;

        int curr = list.get(0);

        for (int i = 0; i < list.size(); i++) {
            if (list.get(i) != curr)
                return false;
            curr++;/*  w ww  .  j av a2s  .  c  om*/
        }

        return true;
    }
}

Related

  1. strIsInList(String srcStr, List orgList)
  2. getMax(List ids_int)