Code example for TreeSet

0
    private Context mContext;
    private AlarmManager mAlarmManager;
 
    // runnable --> time to execute in SystemClock 
    private TreeSet<MyEvent> mEventQueue =
            new TreeSet<MyEvent>(new MyEventComparator());
 
    private PendingIntent mPendingIntent;
 
    private Executor mExecutor;
 
    public SipWakeupTimer(Context context, Executor executor) {
        mContext = context;
        mAlarmManager = (AlarmManager)
                context.getSystemService(Context.ALARM_SERVICE);
 
        IntentFilter filter = new IntentFilter(getAction());
        context.registerReceiver(this, filter);
        mExecutor = executor;
    }