Here you can find the source of maxEltsInOneSetOfValues(ArrayList values)
maxEltsInOneSetOfValues
method takes in values for the attributes and returns the max number of elements in one set of values
Parameter | Description |
---|---|
values | an <code>ArrayList</code> of <code>ArrayList</code>s of values |
int
corresponding to the max number of elements in one set of values
public static int maxEltsInOneSetOfValues(ArrayList values)
//package com.java2s; /* This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *//*from ww w . j a va2 s .c o m*/ import java.util.ArrayList; public class Main { /** * The <code>maxEltsInOneSetOfValues</code> method takes in values for the attributes * and returns the max number of elements in one set of values * * @param values an <code>ArrayList</code> of <code>ArrayList</code>s of values * @return an <code>int</code> corresponding to the max number of elements in one set of values */ public static int maxEltsInOneSetOfValues(ArrayList values) { int max = 0; ArrayList oneSetOfValues = null; for (int i = 0; i < values.size(); i++) { oneSetOfValues = (ArrayList) values.get(i); if (oneSetOfValues.size() > max) { max = oneSetOfValues.size(); } } return max; } }