Here you can find the source of getFirstColumn(List> llo, String reason)
Parameter | Description |
---|---|
llo | the llo |
reason | the reason |
public static List<Object> getFirstColumn(List<List<Object>> llo, String reason)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /**//from www . j av a 2 s . c o m * Gets the first column. * * @param llo the llo * @param reason the reason * @return the first column */ public static List<Object> getFirstColumn(List<List<Object>> llo, String reason) { return getNthColumn(llo, 0, reason); } /** * Gets the nth column. * * @param llo the llo * @param n the n * @param reason the reason * @return the nth column */ public static List<Object> getNthColumn(List<List<Object>> llo, int n, String reason) { List<Object> lo = new ArrayList<Object>(); for (int i = 0; i < llo.size(); i++) { if (llo.get(0).size() < n) throw new RuntimeException("Insufficient column results, " + reason); lo.add(llo.get(i).get(n)); } return lo; } }