Class ItemCategoryComparator

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

    public class ItemCategoryComparator
    extends java.lang.Object
    implements java.util.Comparator<Item>
    Compares items by their category, items of the same category by type (i.e., by name).
    Author:
    stm
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(Item o1, Item o2)  
      static java.util.Comparator<? super Item> getInstance()  
      • 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

      • ItemCategoryComparator

        public ItemCategoryComparator()
    • Method Detail

      • getInstance

        public static java.util.Comparator<? super Item> getInstance()
        Returns:
        An instance of this comparator.
      • compare

        public int compare​(Item o1,
                           Item o2)
        Specified by:
        compare in interface java.util.Comparator<Item>