games.strategy.triplea.util
Class UnitSeperator

java.lang.Object
  extended by games.strategy.triplea.util.UnitSeperator

public class UnitSeperator
extends java.lang.Object

Seperates a group of units into distinct categories.


Method Summary
static java.util.Set<UnitCategory> categorize(java.util.Collection<Unit> units)
           
static java.util.Set<UnitCategory> categorize(java.util.Collection<Unit> units, java.util.Map<Unit,java.util.Collection<Unit>> dependent, boolean categorizeMovement)
          Legacy interface.
static java.util.Set<UnitCategory> categorize(java.util.Collection<Unit> units, java.util.Map<Unit,java.util.Collection<Unit>> dependent, boolean categorizeMovement, boolean sort)
           
static java.util.Set<UnitCategory> categorize(java.util.Collection<Unit> units, java.util.Map<Unit,java.util.Collection<Unit>> dependent, boolean categorizeMovement, boolean categorizeTrnMovement, boolean sort)
          Break the units into discrete categories.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

categorize

public static java.util.Set<UnitCategory> categorize(java.util.Collection<Unit> units)

categorize

public static java.util.Set<UnitCategory> categorize(java.util.Collection<Unit> units,
                                                     java.util.Map<Unit,java.util.Collection<Unit>> dependent,
                                                     boolean categorizeMovement,
                                                     boolean sort)

categorize

public static java.util.Set<UnitCategory> categorize(java.util.Collection<Unit> units,
                                                     java.util.Map<Unit,java.util.Collection<Unit>> dependent,
                                                     boolean categorizeMovement,
                                                     boolean categorizeTrnMovement,
                                                     boolean sort)
Break the units into discrete categories. Do this based on unit owner, and optionally dependent units and movement

Parameters:
dependent - - can be null
categorizeMovement - - whether to categorize by movement
categorizeTrnMovement - - whether to categorize transports by movement
- - sort - if true then sort the categories in UnitCategory order - if false, then leave categories in original order (based on units)
Returns:
a Collection of UnitCategories

categorize

public static java.util.Set<UnitCategory> categorize(java.util.Collection<Unit> units,
                                                     java.util.Map<Unit,java.util.Collection<Unit>> dependent,
                                                     boolean categorizeMovement)
Legacy interface. Break the units into discrete categories. Do this based on unit owner, and optionally dependent units and movement

Parameters:
dependent - - can be null
categorizeMovement - - whether to categorize by movement
Returns:
a Collection of UnitCategories