I dont know what you are trying to compare. If t1 and t2 are
instances of type Double or Integer..etc, you can just use that
specific Wrapper class's compareTo() method.
If you really want to cast that Object which is of type String to an
int, this is how:
public int compareTo (Object t)
{
int temp = Integer.parseInt ( String )t );
return temp;
}