hu.mta.sztaki.lpds.cloud.simulator.util
Class ArrayHandler

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.util.ArrayHandler

public class ArrayHandler
extends Object


Constructor Summary
ArrayHandler()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayHandler

public ArrayHandler()
Method Detail

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 element
toRemoveWhat - 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.