hu.mta.sztaki.lpds.cloud.simulator.util
Class ArrayHandler
java.lang.Object
hu.mta.sztaki.lpds.cloud.simulator.util.ArrayHandler
public class ArrayHandler
- extends Object
Method Summary |
static
|
removeAndReplaceWithLast(ArrayList<T> toRemoveFrom,
T toRemoveWhat)
An item removal function that brings the last element from the array to
the place of the to be removed item. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ArrayHandler
public ArrayHandler()
removeAndReplaceWithLast
public static <T> boolean removeAndReplaceWithLast(ArrayList<T> toRemoveFrom,
T toRemoveWhat)
- An item removal function that brings the last element from the array to
the place of the to be removed item. It ruins the order of the array, but
it is faster than the stock remove operation.
- Parameters:
toRemoveFrom
- The arraylist which is supposedly containing the elementtoRemoveWhat
- The element to be removed
- Returns:
- true if the element was successfully removed, false otherwise.
Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.