Class IntComparatorChain

  • All Implemented Interfaces:
    it.unimi.dsi.fastutil.ints.IntComparator, Serializable, Comparator<Integer>

    public class IntComparatorChain
    extends Object
    implements it.unimi.dsi.fastutil.ints.IntComparator, Serializable
    An IntComparator that wraps one or more Comparators in sequence. The ComparatorChain calls each Comparator in sequence until either 1) any single Comparator returns a non-zero result (and that result is then returned), or 2) the ComparatorChain is exhausted (and zero is returned)

    The implementation is based on Apache Commons Collections

    See Also:
    Serialized Form
    • Constructor Detail

      • IntComparatorChain

        public IntComparatorChain​(it.unimi.dsi.fastutil.ints.IntComparator comparator)
        Constructs a comparator chain with the argument as the first node in the chain
    • Method Detail

      • addComparator

        public void addComparator​(it.unimi.dsi.fastutil.ints.IntComparator comparator)
        Appends the comparator to the end of the chain
      • size

        public int size()
        Returns the number of comparators in the chain
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object