public int compareTo ( Object other ) { if ( other == this ) return 0 ; TimerTask t = ( TimerTask ) other ; long diff = getNextExecutionTime ( ) - t . getNextExecutionTime ( ) ; return ( int ) diff ; }
A TimerTask is less than another if it will be scheduled before .