WebFioriAPI ReferenceLearnDownloadContributeLearn{{result.parent_page}} > {{result.title}}{{result.title}}Classes{{result.class_name}}{{result.summary}}Methods{{result.name}}{{result.summary}}

namespace \webfiori\collections

class Queue

Class Methods Summary

public function &dequeue()Removes the top element from the queue.public function &peek()Returns the element that exist on the top of the queue.public function __construct(int$max)Constructs a new instance of the class.public function add(mixed$el)Adds new element to the bottom of the queue.public function enqueue(mixed$el)Adds new element to the bottom of the queue.public function max()Returns the number of maximum elements the queue can hold.public function size()Returns the number of elements in the queue.public function toArray()Returns an indexed array that contains the elements of the queue.

Class Methods Details

public function &dequeue()Removes the top element from the queue. Returns: mixedThe element after removal from the queue. If the queue is empty, the method will return null.public function &peek()Returns the element that exist on the top of the queue. This method will return the first element that was added to the queue.Returns: mixedThe element at the top. If the queue is empty, the method will return null.public function __construct(int$max)Constructs a new instance of the class.

Parameters:

  • int $max The maximum number of elements the queue can hold. if a negative number is given or 0, the queue will have unlimited number of elements. Also if the given value is not an integer, the maximum will be set to unlimited. Default is 0.
public function add(mixed$el)Adds new element to the bottom of the queue.

Parameters:

  • mixed $el The element that will be added. If it is null, the method will not add it.
Returns: booleanThe method will return true if the element is added. The method will return false only in two cases, If the maximum number of elements is reached and trying to add new one or the given element is null.
public function enqueue(mixed$el)Adds new element to the bottom of the queue.

Parameters:

  • mixed $el The element that will be added. If it is null, the method will not add it.
Returns: booleanThe method will return true if the element is added. The method will return false only in two cases, If the maximum number of elements is reached and trying to add new one or the given element is null.
public function max()Returns the number of maximum elements the queue can hold. Returns: intIf the maximum number of elements was set to 0 or a negative number, the method will return -1 which indicates that the queue can have any number of elements. Other than that, the method will return the maximum number of elements.public function size()Returns the number of elements in the queue. Returns: intThe number of elements in the queue.public function toArray()Returns an indexed array that contains the elements of the queue. Returns: arrayAn indexed array that contains the elements of the queue.
mdi-menuAll Classesmdi-chevron-leftAnchorBrCodeSnippetHTMLDocHTMLListHTMLNodeHTMLTableHeadNodeInputJsCodeLabelListItemOrderedListParagraphRadioGroupTableCellTableRowUnorderedListInvalidNodeNameExceptionTemplateNotFoundExceptionCaseConverterJsonJsonConverterJsonIJsonTypesPropertyAPIFilterAbstractWebServiceManagerInfoServiceParamTypesRequestRequestParameterResponseUriWebServicesManagerAccessAutoLoaderConfigConfigControllerDBEAbstractWebServiceExtendedWebServicesManagerFileLoggerPrivilegePrivilegesGroupThemeThemeLoaderUploadFileUploaderUserUtilWebFioriAppLanguageErrorBoxHTTPCodeViewMessageBoxServerErrViewStarterPageWebPageDatabaseSessionStorageDefaultSessionStorageMSSQLSessionDataTableMSSQLSessionsTableMySQLSessionDataTableMySQLSessionsTableSessionSessionOperationsSessionStorageSessionsManagerRouterRouterUriAbstractMiddlewareMiddlewareManagerEmailMessageSMTPAccountSMTPServerClassLoaderExceptionFileExceptionInitializationExceptionInvalidCRONExprExceptionMissingLangExceptionNoSuchThemeExceptionRoutingExceptionSMTPExceptionSessionExceptionUIExceptionAbstractJobCronCronEmailCronJobJobArgumentCronLoginViewCronTasksViewCronViewCronLoginServiceCronLogoutServiceCronServicesManagerForceCronExecutionServiceGetJobsServiceCLICLICommandInputStreamOutputStreamStdInStdOutClassWriterLangClassWriterQueryClassWriterServiceHolderThemeClassWriterWebServiceWriterCreateCLIClassHelperCreateCronJobCreateMiddlewareCreateTableCreateTableObjCreateThemeHelperCreateWebServiceAddCommandCreateCommandCronCommandHelpCommandListCronCommandListRoutesCommandListThemesCommandRunSQLQueryCommandSettingsCommandTestRouteCommandUpdateSettingsCommandUpdateTableCommandVersionCommandAbstractQueryColumnColumnFactoryConditionConnectionConnectionInfoDatabaseDatabaseExceptionDateTimeValidatorEntityMapperExpressionForeignKeyJoinTableResultSetSelectExpressionTableWhereExpressionMySQLColumnMySQLConnectionMySQLQueryMySQLTableMSSQLColumnMSSQLConnectionMSSQLQueryMSSQLTableAbstractCollectionComparableLinkedListNodeQueueStack
Powered By: WebFiori Framework, Vue and VuetifyAll Rights Reserved © 2018 - 2024