# | Line 851 | Line 851 | public class PriorityBlockingQueue<E> ex | |
---|---|---|
851 | removeEq(array[lastRet]); | |
852 | lastRet = -1; | |
853 | } | |
854 | + | |
855 | + | public void forEachRemaining(Consumer<? super E> action) { |
856 | + | Objects.requireNonNull(action); |
857 | + | final Object[] es = array; |
858 | + | int i; |
859 | + | if ((i = cursor) < es.length) { |
860 | + | lastRet = -1; |
861 | + | cursor = es.length; |
862 | + | for (; i < es.length; i++) |
863 | + | action.accept((E) es[i]); |
864 | + | lastRet = es.length - 1; |
865 | + | } |
866 | + | } |
867 | } | |
868 | ||
869 | /** |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |