Class UnitContainerOwnerComparator

  • All Implemented Interfaces:
    java.util.Comparator<UnitContainer>

    public class UnitContainerOwnerComparator
    extends java.lang.Object
    implements java.util.Comparator<UnitContainer>
    A comparator imposing a total ordering on unit containers based on their owner
    • Constructor Summary

      Constructors 
      Constructor Description
      UnitContainerOwnerComparator​(java.util.Comparator<? super Unit> unitComparator)
      Creates a new UnitContainerOwnerComparator object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(UnitContainer o1, UnitContainer o2)
      Compares its two arguments for order according to their ids.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • UnitContainerOwnerComparator

        public UnitContainerOwnerComparator​(java.util.Comparator<? super Unit> unitComparator)
        Creates a new UnitContainerOwnerComparator object.
    • Method Detail

      • compare

        public int compare​(UnitContainer o1,
                           UnitContainer o2)
        Compares its two arguments for order according to their ids.
        Specified by:
        compare in interface java.util.Comparator<UnitContainer>
        Returns:
        a container with an owner is less then a container without an owner.