Here you can find the source of removeAfter(List> children, int index)
Parameter | Description |
---|---|
children | a parameter |
index | a parameter |
public static void removeAfter(List<?> children, int index)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w w w.java 2 s . c o m*/ * IBM Corporation - initial API and implementation *******************************************************************************/ import java.util.List; public class Main { /** * Removes all elements after the given index * * @param children * @param index */ public static void removeAfter(List<?> children, int index) { while (children.size() > index + 1) { children.remove(children.size() - 1); } } }