Return the first element on the queue.

@return the first element on the queue.
@throws NoSuchElementException if the queue is empty.
510565
public final Object dequeue()
    throws NoSuchElementException
  {
//    if (tc.isEntryEnabled())
//      SibTr.entry(tc, "dequeue");

    if (m_head == m_tail)
      throw new NoSuchElementException();
    Object obj = m_array[m_head];
    m_array[m_head++] = null;
    if (m_head == m_array.length)
      m_head = 0;

//    if (tc.isEntryEnabled())
//      SibTr.exit(tc, "dequeue", obj);
    return obj;
  }
908754
public WebElement findElement() {
        if (cachedElement != null && shouldCache) {
            return cachedElement;
        }

        By bySearching = getBy(this.by, searchContext);
        try {
            WebElement result =  waitFor(() ->
                    searchContext.findElement(bySearching));
            if (shouldCache) {
                cachedElement = result;
            }
            return result;
        } catch (TimeoutException | StaleElementReferenceException e) {
            throw new NoSuchElementException(format(exceptionMessageIfElementNotFound, bySearching.toString()), e);
        }
    }
680955
public Entry getFirst()
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "getFirst");

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "getFirst", first);

    return first;
  }
1114960
public function first() {
		$this->limit(1);
		$result = $this->find();
		return empty($result) ? null : $result[0];
	}
165910
public T pollFirst() {
    if (head == null) {
      return null;
    }
    T first = head.element;
    this.remove(first);
    return first;
  }
88032
public function first()
    {
        $this->throwExceptionIfEmpty();

        $keys = $this->keys();
        $keyOfTheFirstElement = $keys->shift();
        return $this->offsetGet($keyOfTheFirstElement);
    }
602833
public E get(final int index) {
        final int sz = size();
        if (index < 0 || index >= sz) {
            throw new NoSuchElementException(
                String.format("The specified index (%1$d) is outside the available range [0, %2$d)",
                    Integer.valueOf(index), Integer.valueOf(sz)));
        }

        final int idx = (start + index) % maxElements;
        return elements[idx];
    }
481753
public synchronized T next() {
	if (current == null) {
	    throw new NoSuchElementException();
	}
	T t = current.next();
        // Once an element has been drawn from the iterator, the current
        // iterator should be used for any subsequent remove call.
        if (toRemoveFrom != current)
            toRemoveFrom = current;
	advance();
	return t;
    }
438810
public function first()
    {
        $this->sort();

        return !empty($this->items) ? reset($this->items) : null;
    }
1043656
public E next() {
		if(!hasNext()) {
			throw new NoSuchElementException();
		}
		E retObject = next;
		next = null;
		return retObject;
	}
149194
public Object previous() {
        Object element = null;
        if (previousElement != null) {
            element = previousElement;
            previousElement = null;
        } else {
            element = getPreviousElement();
            if (element == null) {
                throw new java.util.NoSuchElementException();
            }
        }
        return element;
    }
323124
public byte[] element() throws Exception
    {
        byte[] bytes = internalElement(false, null);
        if ( bytes == null )
        {
            throw new NoSuchElementException();
        }
        return bytes;
    }
823891
public Object firstKey() throws NoSuchElementException {
        Entry first = (mReverse) ? mLeastRecent : mMostRecent;
        if (first != null) {
            return first.mKey;
        }
        else if (mRecentMap.size() == 0) {
            throw new NoSuchElementException();
        }
        else {
            return null;
        }
    }
55477
public function first()
	{
		$set = array_slice($this->list, 0, 1, true);
		
		return isset($set[0]) ? $set[0] : null;
	}
903609
public void next() {
        boolean hasLeft = currentLeft != null;
        boolean hasRight = currentRight != null;

        if (!hasLeft && !hasRight) {
            throw new NoSuchElementException();
        }

        int order;
        if (hasLeft && !hasRight) {
            order = -1;
        } else if (!hasLeft) {
            order = 1;
        } else {
            order = comparator.compare(currentLeft, currentRight);
        }

        if (order < 0) {
            reportedLeft = currentLeft;
            currentLeft = nextOrNull(left);
            reportedRight = null;
        } else if (order > 0) {
            reportedLeft = null;
            reportedRight = currentRight;
            currentRight = nextOrNull(right);
        } else {
            reportedLeft = currentLeft;
            reportedRight = currentRight;
            currentLeft = nextOrNull(left);
            currentRight = nextOrNull(right);
        }
    }
718070
public static <T> T getFirst(Collection<T> collection) {
		if (isEmpty(collection)) {
			return null;
		}
		if (collection instanceof List) {
			return ((List<T>) collection).get(0);
		}
		return collection.iterator().next();
	}
1096597
@Override
    public Element nextElement()
                    throws NoSuchElementException
    {

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        // If the current bucket has been exhausted, try to find
        // another non-empty bucket.
        if (ivElementIndex >= ivBucketSize)
        {
            if (!findNextBucket()) {
                // No more non-empty buckets, no more elements
                throw new NoSuchElementException();
            }
        }

        // Return the next element from the current bucket.
        // Note that we do not have to worry about concurrent
        // access to the bucket, as this is actually a copy
        // of the bucket, and not the actual bucket in
        // the Cache being enumerated.

        if (isTraceOn && tc.isDebugEnabled())
            ivElementsReturned++;

        return ivBucket[ivElementIndex++];
    }