Lines Matching refs:head

96      * thus avoiding head and tail wrapping around to equal each
103 * The index of the element at the head of the deque (which is the
107 transient int head;
149 * when head and tail have wrapped around to become equal.
152 assert head == tail;
153 int p = head;
163 head = 0;
213 elements[head = (head - 1) & (elements.length - 1)] = e;
214 if (head == tail)
230 if ( (tail = (tail + 1) & (elements.length - 1)) == head)
280 final int h = head;
286 head = (h + 1) & (elements.length - 1);
308 E result = (E) elements[head];
327 // elements[head] is null if deque empty
328 return (E) elements[head];
338 * deque (when traversing the deque from head to tail).
351 int i = head;
364 * deque (when traversing the deque from head to tail).
418 * Retrieves and removes the head of the queue represented by this deque.
425 * @return the head of the queue represented by this deque
433 * Retrieves and removes the head of the queue represented by this deque
439 * @return the head of the queue represented by this deque, or
447 * Retrieves, but does not remove, the head of the queue represented by
453 * @return the head of the queue represented by this deque
461 * Retrieves, but does not remove, the head of the queue represented by
466 * @return the head of the queue represented by this deque, or
504 assert head == tail ? elements[head] == null :
505 (elements[head] != null &&
507 assert elements[(head - 1) & (elements.length - 1)] == null;
512 * adjusting head and tail as necessary. This can result in motion of
524 final int h = head;
529 // Invariant: head <= i < tail mod circularity
543 head = (h + 1) & mask;
567 return (tail - head) & (elements.length - 1);
576 return head == tail;
581 * will be ordered from first (head) to last (tail). This is the same
599 private int cursor = head;
662 * instead of head for initial cursor, and head instead of tail
667 private int fence = head;
680 if (head != fence || result == null)
691 fence = head;
708 int i = head;
739 int h = head;
742 head = tail = 0;
766 final int head = this.head;
768 boolean wrap = (tail < head);
770 Object[] a = Arrays.copyOfRange(elements, head, end);
772 System.arraycopy(elements, 0, a, elements.length - head, tail);
814 final int head = this.head;
816 boolean wrap = (tail < head);
817 int size = (tail - head) + (wrap ? elements.length : 0);
821 a = (T[]) Arrays.copyOfRange(elements, head, head + size,
824 System.arraycopy(elements, head, a, 0, firstLeg);
871 for (int i = head; i != tail; i = (i + 1) & mask)
889 head = 0;
930 index = deq.head;