Here you can find the source of create2DHorizontalIndexList( final int n)
Parameter | Description |
---|---|
n | size of 2d index |
public static List<List<Integer>> create2DHorizontalIndexList( final int n)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /**//from w ww .ja v a 2s . c o m * @param n size of 2d index * @return a 2D index like { {0,1,2,...,n-1} } */ public static List<List<Integer>> create2DHorizontalIndexList( final int n) { List<List<Integer>> result = new ArrayList<List<Integer>>(); result.add(new ArrayList<Integer>()); for (int i = 0; i < n; i++) { result.get(0).add(i); } return result; } }