ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166x/LinkedBlockingDeque.java
(Generate patch)

Comparing jsr166/src/jsr166x/LinkedBlockingDeque.java (file contents):
Revision 1.11 by jsr166, Sun Nov 18 18:03:10 2012 UTC vs.
Revision 1.15 by jsr166, Tue Feb 5 17:34:19 2013 UTC

# Line 76 | Line 76 | public class LinkedBlockingDeque<E>
76      private final Condition notFull = lock.newCondition();
77  
78      /**
79 <     * Creates a <tt>LinkedBlockingDeque</tt> with a capacity of
79 >     * Creates a {@code LinkedBlockingDeque} with a capacity of
80       * {@link Integer#MAX_VALUE}.
81       */
82      public LinkedBlockingDeque() {
# Line 84 | Line 84 | public class LinkedBlockingDeque<E>
84      }
85  
86      /**
87 <     * Creates a <tt>LinkedBlockingDeque</tt> with the given (fixed)
87 >     * Creates a {@code LinkedBlockingDeque} with the given (fixed)
88       * capacity.
89       * @param capacity the capacity of this deque
90 <     * @throws IllegalArgumentException if <tt>capacity</tt> is less than 1
90 >     * @throws IllegalArgumentException if {@code capacity} is less than 1
91       */
92      public LinkedBlockingDeque(int capacity) {
93          if (capacity <= 0) throw new IllegalArgumentException();
# Line 95 | Line 95 | public class LinkedBlockingDeque<E>
95      }
96  
97      /**
98 <     * Creates a <tt>LinkedBlockingDeque</tt> with a capacity of
98 >     * Creates a {@code LinkedBlockingDeque} with a capacity of
99       * {@link Integer#MAX_VALUE}, initially containing the elements of the
100       * given collection,
101       * added in traversal order of the collection's iterator.
102       * @param c the collection of elements to initially contain
103 <     * @throws NullPointerException if <tt>c</tt> or any element within it
104 <     * is <tt>null</tt>
103 >     * @throws NullPointerException if {@code c} or any element within it
104 >     * is {@code null}
105       */
106      public LinkedBlockingDeque(Collection<? extends E> c) {
107          this(Integer.MAX_VALUE);
# Line 113 | Line 113 | public class LinkedBlockingDeque<E>
113      // Basic linking and unlinking operations, called only while holding lock
114  
115      /**
116 <     * Link e as first element, or return false if full
116 >     * Links e as first element, or returns false if full.
117       */
118      private boolean linkFirst(E e) {
119          if (count >= capacity)
# Line 131 | Line 131 | public class LinkedBlockingDeque<E>
131      }
132  
133      /**
134 <     * Link e as last element, or return false if full
134 >     * Links e as last element, or returns false if full.
135       */
136      private boolean linkLast(E e) {
137          if (count >= capacity)
# Line 444 | Line 444 | public class LinkedBlockingDeque<E>
444      /**
445       * Returns the number of elements in this deque.
446       *
447 <     * @return  the number of elements in this deque.
447 >     * @return  the number of elements in this deque
448       */
449      public int size() {
450          lock.lock();
# Line 459 | Line 459 | public class LinkedBlockingDeque<E>
459       * Returns the number of elements that this deque can ideally (in
460       * the absence of memory or resource constraints) accept without
461       * blocking. This is always equal to the initial capacity of this deque
462 <     * less the current <tt>size</tt> of this deque.
462 >     * less the current {@code size} of this deque.
463       * <p>Note that you <em>cannot</em> always tell if
464 <     * an attempt to <tt>add</tt> an element will succeed by
465 <     * inspecting <tt>remainingCapacity</tt> because it may be the
466 <     * case that a waiting consumer is ready to <tt>take</tt> an
464 >     * an attempt to {@code add} an element will succeed by
465 >     * inspecting {@code remainingCapacity} because it may be the
466 >     * case that a waiting consumer is ready to {@code take} an
467       * element out of an otherwise full deque.
468       */
469      public int remainingCapacity() {
# Line 641 | Line 641 | public class LinkedBlockingDeque<E>
641  
642      /**
643       * Returns an iterator over the elements in this deque in proper sequence.
644 <     * The returned <tt>Iterator</tt> is a "weakly consistent" iterator that
644 >     * The returned {@code Iterator} is a "weakly consistent" iterator that
645       * will never throw {@link java.util.ConcurrentModificationException},
646       * and guarantees to traverse elements as they existed upon
647       * construction of the iterator, and may (but is not guaranteed to)
648       * reflect any modifications subsequent to construction.
649       *
650 <     * @return an iterator over the elements in this deque in proper sequence.
650 >     * @return an iterator over the elements in this deque in proper sequence
651       */
652      public Iterator<E> iterator() {
653          return new Itr();
# Line 664 | Line 664 | public class LinkedBlockingDeque<E>
664           * an element exists in hasNext(), we must return item read
665           * under lock (in advance()) even if it was in the process of
666           * being removed when hasNext() was called.
667 <         **/
667 >         */
668          private E nextItem;
669  
670          /**
# Line 720 | Line 720 | public class LinkedBlockingDeque<E>
720       * Saves the state to a stream (that is, serializes it).
721       *
722       * @serialData The capacity (int), followed by elements (each an
723 <     * <tt>Object</tt>) in the proper order, followed by a null
723 >     * {@code Object}) in the proper order, followed by a null
724       * @param s the stream
725       */
726      private void writeObject(java.io.ObjectOutputStream s)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines