private int compareTo(long t) { long thisTime = getMillisOf(this); return (thisTime > t) ? 1 : (thisTime == t) ? 0 : -1; }
private int compareTo(long t) { long thisTime = getMillisOf(this); return (thisTime > t) ? 1 : (thisTime == t) ? 0 : -1; }
/** * Returns a hash code for this calendar. * * @return a hash code value for this object. * @since 1.2 */ public int hashCode() { // 'otheritems' represents the hash code for the previous versions. int otheritems = (lenient ? 1 : 0) | (firstDayOfWeek << 1) | (minimalDaysInFirstWeek << 4) | (zone.hashCode() << 7); long t = getMillisOf(this); return (int) t ^ (int)(t >> 32) ^ otheritems; }
/** * Returns a hash code for this calendar. * * @return a hash code value for this object. * @since 1.2 */ public int hashCode() { // 'otheritems' represents the hash code for the previous versions. int otheritems = (lenient ? 1 : 0) | (firstDayOfWeek << 1) | (minimalDaysInFirstWeek << 4) | (zone.hashCode() << 7); long t = getMillisOf(this); return (int) t ^ (int)(t >> 32) ^ otheritems; }
/** * Compares the time values (millisecond offsets from the <a * href="#Epoch">Epoch</a>) represented by two * <code>Calendar</code> objects. * * @param anotherCalendar the <code>Calendar</code> to be compared. * @return the value <code>0</code> if the time represented by the argument * is equal to the time represented by this <code>Calendar</code>; a value * less than <code>0</code> if the time of this <code>Calendar</code> is * before the time represented by the argument; and a value greater than * <code>0</code> if the time of this <code>Calendar</code> is after the * time represented by the argument. * @exception NullPointerException if the specified <code>Calendar</code> is * <code>null</code>. * @exception IllegalArgumentException if the time value of the * specified <code>Calendar</code> object can't be obtained due to * any invalid calendar values. * @since 1.5 */ public int compareTo(Calendar anotherCalendar) { return compareTo(getMillisOf(anotherCalendar)); }
/** * Compares the time values (millisecond offsets from the <a * href="#Epoch">Epoch</a>) represented by two * <code>Calendar</code> objects. * * @param anotherCalendar the <code>Calendar</code> to be compared. * @return the value <code>0</code> if the time represented by the argument * is equal to the time represented by this <code>Calendar</code>; a value * less than <code>0</code> if the time of this <code>Calendar</code> is * before the time represented by the argument; and a value greater than * <code>0</code> if the time of this <code>Calendar</code> is after the * time represented by the argument. * @exception NullPointerException if the specified <code>Calendar</code> is * <code>null</code>. * @exception IllegalArgumentException if the time value of the * specified <code>Calendar</code> object can't be obtained due to * any invalid calendar values. * @since 1.5 */ public int compareTo(Calendar anotherCalendar) { return compareTo(getMillisOf(anotherCalendar)); }
try { Calendar that = (Calendar)obj; return compareTo(getMillisOf(that)) == 0 && lenient == that.lenient && firstDayOfWeek == that.firstDayOfWeek &&
try { Calendar that = (Calendar)obj; return compareTo(getMillisOf(that)) == 0 && lenient == that.lenient && firstDayOfWeek == that.firstDayOfWeek &&