From d23e7fff4da9bbfd7ee85ff34c78de631d55c4a5 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 26 Feb 2016 17:04:42 +0300 Subject: Message is Comparable --- src/main/java/com/juick/Message.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/com/juick/Message.java b/src/main/java/com/juick/Message.java index 10f7c698..263a247d 100644 --- a/src/main/java/com/juick/Message.java +++ b/src/main/java/com/juick/Message.java @@ -23,7 +23,7 @@ import java.util.*; * * @author Ugnich Anton */ -public class Message { +public class Message implements Comparable { private int MID = 0; @@ -95,6 +95,7 @@ public class Message { return (this.getMID() == jmsg.getMID() && this.getRID() == jmsg.getRID()); } + @Override public int compareTo(Object obj) throws ClassCastException { if (!(obj instanceof Message)) { throw new ClassCastException(); -- cgit v1.2.3