Code example for PriorityBlockingQueue

Methods: add

0
 
        private PriorityBlockingQueue<Pair> backingQueue    = new PriorityBlockingQueue<Pair>(20, comparator); 
 
        @Override 
        public boolean add(Runnable r) { 
            return backingQueue.add(new Pair(r)); 
        } 
 
        @Override 
        public boolean offer(Runnable r) { 
            return backingQueue.offer(new Pair(r)); 
        } 
 
        @Override 
        public boolean offer(Runnable r, long timeout, TimeUnit unit) { 
            return backingQueue.offer(new Pair(r), timeout, unit); 
        } 
 
		@Override 
		public Runnable element() { 
			return backingQueue.element().runnable;