package com.example.smsinbox;

import java.util.Comparator;

public class CustomDateComparator implements Comparator<SmsItem> 
{
    @Override
    public int compare(SmsItem object1, SmsItem object2) 
    {
    	long t1 = object1.getTimeStamp();
	    long t2 = object2.getTimeStamp();
	    
	    if(t2 > t1)
	    {
	    	return 1;
	    }
	    else if(t1 > t2)
	    {
	    	return -1;
	    }
	    
	    return 0;
    }
}