Documentation of 'com.jstatcom.util.ComparatorTypes' Java class
ComparatorTypes
com.jstatcom.util

Class ComparatorTypes

  • All Implemented Interfaces:
    java.util.Comparator<java.lang.Object>


    public abstract class ComparatorTypes
    extends java.lang.Object
    implements java.util.Comparator<java.lang.Object>
    This class contains comparators that can be reused by other classes.

    It implements the typesave enum pattern (Joshua Bloch, "Effective Java", Item 21) . If you compare ComparatorTypes, always use the == operator. This is save, because they are Singletons (Gamma et al., 1995) .

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object o)
      Override prevention method to enforce a.equals(b) if and only if a==b.
      int hashCode()
      Override prevention method invokes super method.
      java.lang.String toString()
      Returns a string representation of this type, do not use for comparisons.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Field Detail

      • STRING_DEFAULT

        public static final ComparatorTypes STRING_DEFAULT
        Compares two strings regardless of their case.
    • Method Detail

      • equals

        public final boolean equals(java.lang.Object o)
        Override prevention method to enforce a.equals(b) if and only if a==b.
        Specified by:
        equals in interface java.util.Comparator<java.lang.Object>
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - object to compare with
        Returns:
        true if mainPeriod, subPeriod and subPeriodicity are the same, false otherwise
      • hashCode

        public final int hashCode()
        Override prevention method invokes super method.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hash code
      • toString

        public final java.lang.String toString()
        Returns a string representation of this type, do not use for comparisons.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of this object.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.