KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > MyTimestamp


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
11   public int myCompareTo(Object JavaDoc o)
12   {
13     System.err.println( "in MyTimestamp(Object)" );
14     return myCompareTo((MyTimestamp)o);
15   }
16             
17 }
18
Popular Tags