Class IntPrimitiveArrayComparator

    • Constructor Detail

      • IntPrimitiveArrayComparator

        public IntPrimitiveArrayComparator​(boolean ascending)
    • Method Detail

      • hash

        public int hash​(int[] record)
        Description copied from class: TypeComparator
        Computes a hash value for the given record. The hash value should include all fields in the record relevant to the comparison.

        The hash code is typically not used as it is in hash tables and for partitioning, but it is further scrambled to make sure that a projection of the hash values to a lower cardinality space is as results in a rather uniform value distribution. However, any collisions produced by this method cannot be undone. While it is NOT important to create hash codes that cover the full spectrum of bits in the integer, it IS important to avoid collisions when combining two value as much as possible.

        Specified by:
        hash in class TypeComparator<int[]>
        Parameters:
        record - The record to be hashed.
        Returns:
        A hash value for the record.
        See Also:
        Object.hashCode()
      • duplicate

        public TypeComparator<int[]> duplicate()
        Description copied from class: TypeComparator
        Creates a copy of this class. The copy must be deep such that no state set in the copy affects this instance of the comparator class.
        Specified by:
        duplicate in class TypeComparator<int[]>
        Returns:
        A deep copy of this comparator instance.