public boolean equals(final Object obj) { if (!(obj instanceof IGYearMonth)) { return false; } IGYearMonth monthyear = (IGYearMonth) obj; return ((monthyear.getMonth() == getMonth()) && (monthyear.getYear() == getYear())); }
public int compareTo(ITerm o) { if (o == null) { return 1; } IGYearMonth gmy = (IGYearMonth) o; int iResult = getYear() - gmy.getYear(); if (iResult != 0) { return iResult; } return getMonth() - gmy.getMonth(); }