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 36)
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(), beforeRemove(), clear(), contains(), exchangeArray(), getClass(), getIterator(), import(), isReadOnly(), remove(), search(), setArray(), setReadOnly(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary
protected int $base 0

line 39


Method Details

line 94

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 49

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 154

offsetExists

public bool offsetExists (int $index)

Exists item? (\ArrayAccess implementation).

Input
int $index index
Output
bool  

line 137

offsetGet

public mixed offsetGet (int $index)

Returns item (\ArrayAccess implementation).

Input
int $index index
Output
mixed  
Throws
throws ArgumentOutOfRangeException

line 113

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 168

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 71

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