com.jstatcom.util
Class ComparatorTypes
- java.lang.Object
-
- com.jstatcom.util.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) .
-
-
Field Summary
Fields Modifier and Type Field and Description static ComparatorTypesSTRING_DEFAULTCompares two strings regardless of their case.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)Override prevention method to enforcea.equals(b)if and onlyif a==b.inthashCode()Override prevention method invokes super method.java.lang.StringtoString()Returns a string representation of this type, do not use for comparisons.
-
-
-
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 enforcea.equals(b)if and onlyif a==b.- Specified by:
equalsin interfacejava.util.Comparator<java.lang.Object>- Overrides:
equalsin classjava.lang.Object- Parameters:
o- object to compare with- Returns:
trueif mainPeriod, subPeriod and subPeriodicity are the same,falseotherwise
-
hashCode
public final int hashCode()
Override prevention method invokes super method.- Overrides:
hashCodein classjava.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:
toStringin classjava.lang.Object- Returns:
- String representation of this object.
-
-
DMelt 3.0 © DataMelt by jWork.ORG