Class ComparableItem<T,​C extends Comparable<C>>

  • Type Parameters:
    T - type of the item.
    C - type of the quantity associated with the item.
    All Implemented Interfaces:
    Comparable<ComparableItem<T,​C>>

    public class ComparableItem<T,​C extends Comparable<C>>
    extends Object
    implements Comparable<ComparableItem<T,​C>>
    A comparable item.

    Note that equality and hash code depend purely in the item, not on the quantity associated with it.

    • Constructor Detail

      • ComparableItem

        public ComparableItem​(T item,
                              C quantity)
        Construct a new comparable item.
        Parameters:
        item - item, must not be null.
        quantity - quantity, must not be null.