Download the PHP package appserver-io/collections without Composer
On this page you can find all versions of the php package appserver-io/collections. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download appserver-io/collections
More information about appserver-io/collections
Files in appserver-io/collections
Package collections
Short Description Package that provides basic PHP collections and utilities.
License OSL-3.0
Homepage https://github.com/appserver-io/collections
Informations about the package collections
PHP collection library
Introduction
This package provides a generic collection library.
The library is based on the SPL extension of PHP5 and uses the introduced iterators. The library also provides, beside the most used collection types, interfaces and exceptions.
Issues
In order to bundle our efforts we would like to collect all issues regarding this package in the main project repository's issue tracker.
Please reference the originating repository as the first element of the issue title e.g.:
[appserver-io/<ORIGINATING_REPO>] A issue I am having
Usage
The following examples will give you a short introduction how you can use the classes provided by this library.
ArrayList
An ArrayList will provide a container that can store items of different data types. With the provided methods, elements can be added, returned oder deleted. The ArrayList is unsorted and has an ongoing integer index that starts with 0.
HashMap
A HashMap will provide a container that can store items of different data types. With the provided methods, elements can be added, returned oder deleted. The HashMap is unsorted like an ArrayList and all simple data types are supported as index.
Dictionary
A Dictionary, like an ArrayList or a HashMap, will provide a container that can store items of different data types. With the provided methods, elements can be added, returned oder deleted. The Dictionary is unsorted like an ArrayList. But in opposite to an ArrayList or a HashMap, between simple data types, also objects are allowed as index.
TreeMap
The usage of a TreeMap is very similar to a HashMap. The main difference is, that the items are either sorted ascending, or by the Predicate passed to the constructor.
The next example gives you an example implementation for using a TreeMap, sorted with a Comparator.
External Links
- Documentation at appserver.io