Lines Matching refs:head

92      * thus avoiding head and tail wrapping around to equal each
99 * The index of the element at the head of the deque (which is the
103 private transient int head;
145 * when head and tail have wrapped around to become equal.
148 assert head == tail;
149 int p = head;
159 head = 0;
171 if (head < tail) {
172 System.arraycopy(elements, head, a, 0, size());
173 } else if (head > tail) {
174 int headPortionLen = elements.length - head;
175 System.arraycopy(elements, head, a, 0, headPortionLen);
227 elements[head = (head - 1) & (elements.length - 1)] = e;
228 if (head == tail)
244 if ( (tail = (tail + 1) & (elements.length - 1)) == head)
293 int h = head;
298 head = (h + 1) & (elements.length - 1);
316 E x = elements[head];
333 return elements[head]; // elements[head] is null if deque empty
342 * deque (when traversing the deque from head to tail).
356 int i = head;
370 * deque (when traversing the deque from head to tail).
426 * Retrieves and removes the head of the queue represented by this deque.
433 * @return the head of the queue represented by this deque
441 * Retrieves and removes the head of the queue represented by this deque
447 * @return the head of the queue represented by this deque, or
455 * Retrieves, but does not remove, the head of the queue represented by
461 * @return the head of the queue represented by this deque
469 * Retrieves, but does not remove, the head of the queue represented by
474 * @return the head of the queue represented by this deque, or
512 assert head == tail ? elements[head] == null :
513 (elements[head] != null &&
515 assert elements[(head - 1) & (elements.length - 1)] == null;
520 * adjusting head and tail as necessary. This can result in motion of
532 final int h = head;
537 // Invariant: head <= i < tail mod circularity
551 head = (h + 1) & mask;
575 return (tail - head) & (elements.length - 1);
584 return head == tail;
589 * will be ordered from first (head) to last (tail). This is the same
607 private int cursor = head;
652 * tail instead of head for initial cursor, and head instead of
656 private int fence = head;
668 if (head != fence || result == null)
679 fence = head;
697 int i = head;
729 int h = head;
732 head = tail = 0;
845 for (int i = head; i != tail; i = (i + 1) & mask)
859 head = 0;