Return the first object in the set

@return KObjectHandlable or NULL is queue is empty
321153
public function top()
    {
        $objects = array_values($this->_data);

        $object = null;
        if (isset($objects[0])) {
            $object = $objects[0];
        }

        return $object;
    }
1282420
public static <T> T getFirst(T[] objectArray)
    {
        if (ArrayIterate.notEmpty(objectArray))
        {
            return objectArray[0];
        }
        return null;
    }
79578
public V getFirst(Object key) {
        List<V> res = getAll(key);
        if (res.isEmpty()) {
            return null;
        } else {
            return res.iterator().next();
        }
    }
1269292
public static <T> T first(Iterable<T> objects) {
        if (objects != null) {
            for (T object : objects) {
                return object;
            }
        }
        return null;
    }
1317620
public function first()
    {
        foreach ($this->dataQuery->firstRow()->execute() as $row) {
            return $this->createDataObject($row);
        }
        return null;
    }
665460
public T getFirst() {
        Optional<Rsp<T>> retval=values().stream().filter(rsp -> rsp.getValue() != null).findFirst();
        return retval.isPresent()? retval.get().getValue() : null;
    }
697505
private E firstDataItem() {
        for (Node p = head; p != null; p = succ(p)) {
            Object item = p.item;
            if (p.isData) {
                if (item != null && item != p)
                    return LinkedTransferQueue.<E>cast(item);
            }
            else if (item == null)
                return null;
        }
        return null;
    }
165111
public function first()
    {
        $this->executeBeforeCallback();

        return count($this->items) > 0 ? reset($this->items) : null;
    }
377883
public function queue()
    {
        $log = $this->getLogger();
        $log->info('Queueing operation started', array('collections' => count($this)));

        $event = new CollectorEvent($this);
        $this->dispatchEvent(SearchEvents::COLLECTOR_PRE_QUEUE, $event);

        $num_queued = 0;
        foreach ($this->_collections as $collection) {
            $num_queued += $this->queueCollection($collection);
        }

        $this->dispatchEvent(SearchEvents::COLLECTOR_POST_QUEUE, $event);

        $log->info('Queueing operation completed', array('queued' => $num_queued));
        return $num_queued;
    }
1329835
public function first()
    {
        $sql = clone($this);
        $sql->limit(1);
        $result = $this->_adapter->query($sql, $sql->getParameters());
        return  (count($result) > 0) ? $result[0]: null;
    }
942795
public function first()
	{
		$result = $this->fetchFirst(PDO::FETCH_ASSOC);

		if($result !== false)
		{
			return $this->hydrateModelsAndLoadIncludes([$result])[0];
		}

		return false;
	}
505277
public function first()
    {
        $data = $this->getData();

        if (!$this->where) {
            return $data
                ? $this->convertItem(reset($data))
                : null;
        }

        foreach ($data as &$rs) {
            if ($this->matchWhere($rs)) {
                return $this->convertItem($rs);
            }
        }

        return null;
    }
969044
public function first($object = false)
    {
        $this->prepare();

        $data = $this->_map;
        if (count($data) > 0) {
            return $this->prepareResult(reset($data), $object);
        }

        return null;
    }
579021
public function findFirst()
    {
        $rowset = $this->getTableGateway()
            ->select(
                function(Select $select) {
                    $select->columns($this->columns);
                    $select->limit(1);
                    $select->order('id asc');
                }
            );
        $row = $rowset->current();
        if (!$row) {
            return NULL;
        }
        return $row;
    }
593920
public function first()
    {
        try {
            $row = $this->baseQuery->first();

            if ($row === null) {
                return $row;
            } else {
                return $this->processFetchedRow($row);
            }
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }
786534
public function first()
    {
        foreach ($this as $result) {
            if ($this->_statement && !$this->_useBuffering) {
                $this->_statement->closeCursor();
            }

            return $result;
        }
    }
1007063
public function getFirst()
    {
        $this->internalDataListUpdate();
        if (isset($this->internalDataListData[0])) {
            return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, 0);
        }
        return null;
    }