Class ArrayList (namespace Nette\Collections)


Provides the base class for a generic list (items can be accessed by index).

ArrayObject
   |
   --Collection
      |
      --ArrayList

Implements interfaces:

Direct Known Sub-classes:

Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Collections/ArrayList.php (line 35)
Public Method Summary
int|FALSE
indexOf (mixed $item)
Returns the index of the first occurrence of the specified element,.
bool
insertAt (int $index, mixed $item)
Inserts the specified element at the specified position in this list.
bool
offsetExists (int $index)
Exists item? (\ArrayAccess implementation).
mixed
offsetGet (int $index)
Returns item (\ArrayAccess implementation).
void
offsetSet (int $index, object $item)
Replaces (or appends) the item (\ArrayAccess implementation).
void
offsetUnset (int $index)
Removes the element at the specified position in this list.
bool
remove (mixed $item)
Removes the first occurrence of the specified element.
Methods Inherited From Collection
__construct(), append(), beforeAdd(), clear(), contains(), exchangeArray(), freeze(), getClass(), getItemType(), getIterator(), import(), isFrozen(), isReadOnly(), remove(), search(), setArray(), setReadOnly(), updating(), __call(), __callStatic(), __clone(), __get(), __isset(), __set(), __unset()
Variable Summary
protected int $base 0

line 38


Method Details

line 93

indexOf

public int|FALSE indexOf (mixed $item)

Returns the index of the first occurrence of the specified element,.

or FALSE if this list does not contain this element.

Implementation of:

Input
mixed $item
Output
int|FALSE  

line 48

insertAt

public bool insertAt (int $index, mixed $item)

Inserts the specified element at the specified position in this list.

Implementation of:

Input
int $index
mixed $item
Output
bool  
Throws
throws ArgumentOutOfRangeException

line 153

offsetExists

public bool offsetExists (int $index)

Exists item? (\ArrayAccess implementation).

Input
int $index index
Output
bool  

line 136

offsetGet

public mixed offsetGet (int $index)

Returns item (\ArrayAccess implementation).

Input
int $index index
Output
mixed  
Throws
throws ArgumentOutOfRangeException

line 112

offsetSet

public void offsetSet (int $index, object $item)

Replaces (or appends) the item (\ArrayAccess implementation).

Input
int $index index
object $item
Output
void  
Throws
throws InvalidArgumentException, \NotSupportedException, \ArgumentOutOfRangeException

line 167

offsetUnset

public void offsetUnset (int $index)

Removes the element at the specified position in this list.

Input
int $index index
Output
void  
Throws
throws NotSupportedException, \ArgumentOutOfRangeException

line 70

remove

public bool remove (mixed $item)

Removes the first occurrence of the specified element.

Implementation of:

Input
mixed $item
Output
bool true if this list changed as a result of the call
Throws
throws NotSupportedException