> + public int compareTo(Object je)
> + {
> + long obj1Time = this.getNextRuntime();
> + long obj2Time = ((JobEntry)je).getNextRuntime();
> + if (obj1Time > obj2Time)
> + {
> + return 1;
> + }
> + else if (obj1Time < obj2Time)
> + {
> + return -1;
> + }
> + else
> + {
> + return 0;
> }
> }
I don't really know much about Comparable, but shouldn't
this code check against je being null? Something like:
public int compareTo(Object o)
{
if (o == null)
{
return 1; // anything is "greater than" null???
}
JobEntry je = (JobEntry) o;
return (this.getNextRuntime() - je.getNextRuntime());
}
--
Gonzalo A. Diethelm
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>