\Phabstractic\Data\Types\ResourceListInterface

List Interface - Defines basic list functions

A list can be several things: a stack, a queue, a ring buffer, etc. This list interface defines basic list operators that would exist on any list, be it a stack, a queue, a ring buffer, etc.

CHANGELOG

1.0: Created ListInterface - May 16th, 2013 2.0: Refactored and re-formatted for inclusion in primus - April 11th, 2015 3.0: reformatted for inclusion in phabstractic - July 21st, 2016

Summary

Methods
Constants
top()
topReference()
push()
pushReference()
pop()
popReference()
index()
indexReference()
count()
isEmpty()
clear()
getList()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

top()

top() : mixed

Return the 'top' of the list (lifo/fifo/etc)

Does not 'pop' the value off of the list

Returns

mixed —

The top value of the list

topReference()

topReference() : mixed

Return 'top' value as a reference

Returns

mixed —

The top value as a reference of the list

push()

push() : integer

'Pushes'/Inserts a value into the list

However that is in implementation (lifo/fifo/etc)

Returns

integer —

Number of values in list

pushReference()

pushReference(  $a) : integer

'Pushes'/Inserts a value as a reference into the list

However that is in implementation (lifo/fifo/etc)

Parameters

$a

Returns

integer —

Number of values in list

pop()

pop() : mixed

'Pops'/Takes first value from list, and removes it from list

However that is in implementation (lifo/fifo/etc)

Returns

mixed —

The 'first' value

popReference()

popReference() : mixed

'Pops'/Takes first value from list, and removes it from list

However that is in implementation (lifo/fifo/etc)

Returns

mixed —

The 'first' value as a reference

index()

index(  $i) : mixed

Accesses a specific index in the 'list'

This should be used carefully, as implementation varies

Parameters

$i

Returns

mixed —

The value at the index

indexReference()

indexReference(  $i) : mixed

Accesses the specific index in the 'list'

Parameters

$i

Returns

mixed —

The value as a reference at the index

count()

count() : integer

Implements \Countable Interface Method

Returns

integer —

The number of current elements in the list

isEmpty()

isEmpty() : boolean

Is the list empty?

Returns

boolean —

True if the list is empty

clear()

clear() 

Clears all values out of the list

Be careful!

getList()

getList() : mixed

Returns the potentially internal list, usually array

Implementation varies return value

Returns

mixed —

The internal list variable