public class Date implements java.io.Serializable, Cloneable, Comparable {
private transient Calendar cal;
private transient long fastTime;
private static Calendar staticCal = null;
// ... lots of static fields ...
...
public long getTime() {
return getTimeImpl();
}
private final long getTimeImpl() {
return (cal == null) ? fastTime : cal.getTimeInMillis();
}
...
public boolean equals(Object obj) {
return obj instanceof Date && getTime() == ((Date) obj).getTime();
}
}
End of Listing