skype.TimeSortedMessages Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of skype2gmail Show documentation
Show all versions of skype2gmail Show documentation
Send skype chat history to a gmail account
The newest version!
package skype;
import java.util.Comparator;
import java.util.TreeSet;
@SuppressWarnings("serial")
public class TimeSortedMessages extends TreeSet {
public TimeSortedMessages() {
super(getTimeComparator());
}
private static Comparator getTimeComparator() {
return new Comparator() {
@Override
public int compare(SkypeChatMessage o1, SkypeChatMessage o2) {
int timeComparison = o1.getTime().compareTo(o2.getTime());
if (timeComparison != 0)
return timeComparison;
return o1.getSignature().compareTo(o1.getSignature());
}
};
}
}