import java.util.*;

public class abcastComparator extends TreeSet implements Comparator

{

    public int compare(Object o1, Object o2)

    {
	Message obj1 = (Message)o1;
	Message obj2 = (Message)o2;
 

	if ( this.equals( ((Abcast2)(obj1.getmessageobj())).getpriority() , ((Abcast2)(obj2.getmessageobj())).getpriority() ) == 0 )


    return this.equals(  obj1.getmessagesource() ,  obj2.getmessagesource()  );
    return  this.equals( ((Abcast2) (obj1.getmessageobj()) ).getpriority(), ((Abcast2) obj2.getmessageobj()).getpriority() ) ;


    }

    public int equals(int x, int y)

    {  

	if (x==y) return 0  ;
	if(x<y)  return -1;
	return 1;

    }

    public boolean equals( Object ob)
    {
	return true;

    }


}
