org.mars_sim.msp.core
Class CollectionUtils

java.lang.Object
  extended by org.mars_sim.msp.core.CollectionUtils

public class CollectionUtils
extends Object

This class gather general collection manipulation methods


Constructor Summary
CollectionUtils()
           
 
Method Summary
static Collection<Equipment> getEquipment(Collection<Unit> units)
           
static Collection<Person> getPerson(Collection<Unit> units)
           
static Settlement getRandomRegressionSettlement(Collection<Settlement> collection)
           
static Settlement getRandomSettlement(Collection<Settlement> collection)
           
static Settlement getSettlement(Collection<Settlement> collection, String name)
           
static Collection<Settlement> getSettlement(Collection<Unit> units)
           
static Collection<Vehicle> getVehicle(Collection<Unit> units)
           
static void mergeEquipments(Collection<Unit> units, Collection<Equipment> equipments)
           
static void mergePersons(Collection<Unit> units, Collection<Person> persons)
           
static void mergeSettlements(Collection<Unit> units, Collection<Settlement> settlements)
           
static void mergeVehicles(Collection<Unit> units, Collection<Vehicle> vehicles)
           
static
<T extends Unit>
Collection<T>
sortByName(Collection<T> collection)
           
static
<T extends Unit>
Collection<T>
sortByProximity(Collection<T> collection, Coordinates location)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionUtils

public CollectionUtils()
Method Detail

getEquipment

public static Collection<Equipment> getEquipment(Collection<Unit> units)

mergeEquipments

public static void mergeEquipments(Collection<Unit> units,
                                   Collection<Equipment> equipments)

getVehicle

public static Collection<Vehicle> getVehicle(Collection<Unit> units)

mergeVehicles

public static void mergeVehicles(Collection<Unit> units,
                                 Collection<Vehicle> vehicles)

getPerson

public static Collection<Person> getPerson(Collection<Unit> units)

mergePersons

public static void mergePersons(Collection<Unit> units,
                                Collection<Person> persons)

getSettlement

public static Collection<Settlement> getSettlement(Collection<Unit> units)

mergeSettlements

public static void mergeSettlements(Collection<Unit> units,
                                    Collection<Settlement> settlements)

getRandomSettlement

public static Settlement getRandomSettlement(Collection<Settlement> collection)

getRandomRegressionSettlement

public static Settlement getRandomRegressionSettlement(Collection<Settlement> collection)

getSettlement

public static Settlement getSettlement(Collection<Settlement> collection,
                                       String name)

sortByName

public static <T extends Unit> Collection<T> sortByName(Collection<T> collection)

sortByProximity

public static <T extends Unit> Collection<T> sortByProximity(Collection<T> collection,
                                                             Coordinates location)


Copyright © 2009-2013. All Rights Reserved.