--- jsr166/src/jsr166x/ArrayDeque.java 2010/09/01 05:20:40 1.5
+++ jsr166/src/jsr166x/ArrayDeque.java 2012/12/29 23:55:19 1.10
@@ -1,6 +1,6 @@
/*
* Written by Josh Bloch of Google Inc. and released to the public domain,
- * as explained at http://creativecommons.org/licenses/publicdomain.
+ * as explained at http://creativecommons.org/publicdomain/zero/1.0/.
*/
package jsr166x; // XXX This belongs in java.util!!! XXX
@@ -13,7 +13,7 @@ import java.io.*;
* usage. They are not thread-safe; in the absence of external
* synchronization, they do not support concurrent access by multiple threads.
* Null elements are prohibited. This class is likely to be faster than
- * {@link Stack} when used as as a stack, and faster than {@link LinkedList}
+ * {@link Stack} when used as a stack, and faster than {@link LinkedList}
* when used as a queue.
*
*
Most ArrayDeque operations run in amortized constant time.
@@ -86,9 +86,9 @@ public class ArrayDeque extends Abstr
// ****** Array allocation and resizing utilities ******
/**
- * Allocate empty array to hold the given number of elements.
+ * Allocates empty array to hold the given number of elements.
*
- * @param numElements the number of elements to hold.
+ * @param numElements the number of elements to hold
*/
private void allocateElements(int numElements) {
int initialCapacity = MIN_INITIAL_CAPACITY;
@@ -110,7 +110,7 @@ public class ArrayDeque extends Abstr
}
/**
- * Double the capacity of this deque. Call only when full, i.e.,
+ * Doubles the capacity of this deque. Call only when full, i.e.,
* when head and tail have wrapped around to become equal.
*/
private void doubleCapacity() {
@@ -130,7 +130,7 @@ public class ArrayDeque extends Abstr
}
/**
- * Copy the elements from our element array into the specified array,
+ * Copies the elements from our element array into the specified array,
* in order (from first to last element in the deque). It is assumed
* that the array is large enough to hold all elements in the deque.
*
@@ -517,7 +517,7 @@ public class ArrayDeque extends Abstr
}
/**
- * Remove the element at the specified position in the elements array,
+ * Removes the element at the specified position in the elements array,
* adjusting head, tail, and size as necessary. This can result in
* motion of elements backwards or forwards in the array.
*
@@ -555,9 +555,9 @@ public class ArrayDeque extends Abstr
}
/**
- * Returns true if this collection contains no elements.
+ * Returns true if this collection contains no elements.
*
- * @return true if this collection contains no elements.
+ * @return true if this collection contains no elements
*/
public boolean isEmpty() {
return head == tail;
@@ -667,7 +667,7 @@ public class ArrayDeque extends Abstr
do {
elements[i] = null;
i = (i + 1) & mask;
- } while(i != t);
+ } while (i != t);
}
}
@@ -737,7 +737,7 @@ public class ArrayDeque extends Abstr
private static final long serialVersionUID = 2340985798034038923L;
/**
- * Serialize this deque.
+ * Serializes this deque.
*
* @serialData The current size (int) of the deque,
* followed by all of its elements (each an object reference) in
@@ -760,7 +760,7 @@ public class ArrayDeque extends Abstr
}
/**
- * Deserialize this deque.
+ * Deserializes this deque.
*/
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException {