$list
$list : array
The internal list member
Generally an array, but can be overridden by a child class to be anything.
List Abstract Class - Defines a basic list class, implements ListInterface
A list can be several things: a stack, a queue, a ring buffer, etc. This abstract class implements the ListInterface and defines an internal list variable (list = array). Inherit from this class if you are building a list like class.
CHANGELOG
1.0: Created AbstractList - May 10th, 2013 2.0: Refactored and re-formatted for inclusion in primus - April 11th, 2015 3.0: eliminated dependency on configurationtrait, subs can implement reformatted for inclusion in phabstractic - July 21st, 2016
index(integer $i) : mixed
Return the $i'th element of the list
This should be used carefully, as implementation varies
integer | $i | The numerical index into the list |
If index is out of well... range.
The value found at index of list: list[index]
remove(mixed $value) : \Phabstractic\Data\Types\Resource\Phabstractic\Data\Types\Resource\AbstractList
Remove a value out of the list
This is just in case we want to remove something out of order.
Only removes the first occurance of value
mixed | $value | The value to remove |
For chaining
duplicate() : \Phabstractic\Data\Types\Resource\Phabstractic\Data\Types\Resource\AbstractList
Duplicate the value at the top of the list
Note: Adds the duplicate to the front of the list
For chaining
roll(integer $i)
'Rolls' the list like one might 'roll' a wheel.
Negative values roll the list the opposite direction positive values roll the list.
Note: Edits the list in place, does not return copy of list
EX:
12345 would become 34512
integer | $i | The amount to roll the list |
if parameter isn't integer