MyTimestamp.java 394 B

123456789101112131415161718
  1. public class MyTimestamp extends MyDate
  2. {
  3. int t;
  4. public MyTimestamp(int d, int t) { super(d); this.t = t; }
  5. public int myCompareTo(MyTimestamp ts)
  6. {
  7. return d < ts.d ? -1 : d > ts.d ? 1
  8. : t < ts.t ? -1 : t > ts.t ? 1 : 0;
  9. }
  10. public int myCompareTo(Object o)
  11. {
  12. System.err.println( "in MyTimestamp(Object)" );
  13. return myCompareTo((MyTimestamp)o);
  14. }
  15. }