Sgss_Collection_List_Abstract
+ Sgss_Collection_Array_List
|
$_elements
Indices and elements in this list |
|
$_size
The number of elements in this list |
|
__construct ([array|object|null $elements = null])
The constructor |
boolean |
add (mixed $element)
Appends the specified element at the end of this list |
boolean |
clear ()
Removes all the indices and elements in this list |
mixed |
drop (int $index)
Removes the specified index and the corresponding element from this list |
mixed |
get (int $index)
Returns the element at the specified index of this list |
boolean |
has (mixed $element)
Determines whether this list contains the specified element |
int |
index (mixed $element)
Returns the index at which the specified element first appears in this list |
boolean |
insert (int $index, mixed $element)
Inserts or appends the specified element at the specified index of this list |
boolean |
remove (mixed $element)
Removes the specified element from this list |
mixed |
set (int $index, mixed $element)
Replaces the element at the specified index of this list to the specified element |
int |
size ()
Returns the number of elements in this list |
array |
toArray ()
Converts this list to an associated array |
Indices and elements in this list
protected array $_elements
The number of elements in this list
protected int $_size = 0
The constructor
array|object|null $elements
Value containing elements to be stored
public __construct ([array|object|null $elements = null])
Appends the specified element at the end of this list
mixed $element
Element to be appended
public boolean add (mixed $element)
Removes all the indices and elements in this list
public boolean clear ()
Removes the specified index and the corresponding element from this list
int $index
Index to be removed
When the specified index is below 0 or beyond the last index of this list
public mixed drop (int $index)
Returns the element at the specified index of this list
int $index
Index of element to be retrieved
When the specified index is below 0 or beyond the last index of this list
public mixed get (int $index)
Determines whether this list contains the specified element
mixed $element
Element to determine
public boolean has (mixed $element)
Returns the index at which the specified element first appears in this list
mixed $element
Element to search
public int index (mixed $element)
Inserts or appends the specified element at the specified index of this list
int $index
Index to insert at
mixed $element
Element to be inserted or appended
When the specified index is below 0 or beyond the size of this list
public boolean insert (int $index, mixed $element)
Removes the specified element from this list
mixed $element
Element to be removed
public boolean remove (mixed $element)
Replaces the element at the specified index of this list to the specified element
int $index
Index of element to be replaced
mixed $element
Element to store
When the specified index is below 0 or beyond the last index of this list
public mixed set (int $index, mixed $element)
Returns the number of elements in this list
public int size ()
Converts this list to an associated array
public array toArray ()