Class Xyster_Collection_List_Abstract

Description

Implements interfaces:

Abstract class for index-based collections

  • copyright: Copyright (c) 2007-2008 Irrational Logic (http://irrationallogic.net)
  • abstract:
  • license: New BSD License

Located in /Collection/List/Abstract.php (line 31)

Xyster_Collection_Abstract
   |
   --Xyster_Collection_List_Abstract
Direct descendents
Class Description
Xyster_Collection_List Simple implementation of an index-based collection
Method Summary
mixed get (int $index)
int indexOf (mixed $value)
void insert (int $index, mixed $value)
void insertAll (int $index, Xyster_Collection_Interface $values)
boolean offsetExists (int $index)
mixed offsetGet (int $index)
void offsetSet (int $index, mixed $value)
void offsetUnset (int $index)
boolean remove (mixed $item)
void removeAt (int $index)
void set (int $index, mixed $value)
void slice (int $from, int $count)
Variables
Methods
get (line 46)

Gets the value at a specified index

This method is an alias to ArrayAccess::offsetGet

The index must be greater than or equal to 0 and less than or equal to the size of this collection. In other words, an index is valid if

  1. $index || $index $this->count() )
is false.

  • return: The value found at $index
  • throws: OutOfBoundsException if the index is invalid
  • access: public
mixed get (int $index)
  • int $index: The index to get

Implementation of:
Xyster_Collection_List_Interface::get()
Gets the value at a specified index
indexOf (line 57)

Returns the first index found for the specified value

  • return: The first index found, or false if the value isn't contained
  • access: public
int indexOf (mixed $value)
  • mixed $value

Implementation of:
Xyster_Collection_List_Interface::indexOf()
Returns the first index found for the specified value
insert (line 73)

Inserts a value into the list at the specified index

The index must be greater than or equal to 0 and less than or equal to the size of this collection. In other words, an index is valid if

  1. $index || $index $this->count() )
is false.

  • throws: OutOfBoundsException if the index is invalid
  • access: public
void insert (int $index, mixed $value)
  • int $index: The index at which to insert
  • mixed $value: The value to insert

Implementation of:
Xyster_Collection_List_Interface::insert()
Inserts a value into the list at the specified index

Redefined in descendants as:
insertAll (line 92)

Inserts the supplied values into the list at the specified index

The index must be greater than or equal to 0 and less than or equal to the size of this collection. In other words, an index is valid if

  1. $index || $index $this->count() )
is false.

  • throws: OutOfBoundsException if the index is invalid
  • access: public
void insertAll (int $index, Xyster_Collection_Interface $values)

Implementation of:
Xyster_Collection_List_Interface::insertAll()
Inserts the supplied values into the list at the specified index

Redefined in descendants as:
offsetExists (line 106)

Gets whether the specified index exists in the list

  • return: Whether the index is in the list
  • access: public
boolean offsetExists (int $index)
  • int $index: The index to test
offsetGet (line 122)

Gets the value at a specified index

The index must be greater than or equal to 0 and less than the size of this collection. In other words, an index is valid if

  1. $index || $index >= $this->count() )
is false.

  • return: The value found at $index
  • throws: OutOfBoundsException if the index is invalid
  • access: public
mixed offsetGet (int $index)
  • int $index: The index to get
offsetSet (line 141)

Sets the value at a given index.

The index must be greater than or equal to 0 and less than or equal to the size of this collection. In other words, an index is valid if

  1. $index || $index $this->count() )
is false.

  • throws: OutOfBoundsException if the index is invalid
  • access: public
void offsetSet (int $index, mixed $value)
  • int $index: The index to set
  • mixed $value: The value to set

Redefined in descendants as:
offsetUnset (line 159)

Removes a value at the specified index

The index must be greater than or equal to 0 and less than the size of this collection. In other words, an index is valid if

  1. $index || $index $this->count() )
is false.

  • throws: OutOfBoundsException if the index is invalid
  • access: public
void offsetUnset (int $index)
  • int $index: The index to "unset"

Redefined in descendants as:
remove (line 174)

Removes the specified value from the collection

  • return: If the value was in the collection
  • access: public
boolean remove (mixed $item)
  • mixed $item: The value to remove

Redefinition of:
Xyster_Collection_Abstract::remove()
Removes the specified value from the collection

Implementation of:
Xyster_Collection_Interface::remove()
Removes the specified value from the collection

Redefined in descendants as:
removeAll (line 189)

Removes all of the specified values from the collection

  • return: Whether the collection changed as a result of this method
  • access: public
boolean removeAll (Xyster_Collection_Interface $values)

Redefinition of:
Xyster_Collection_Abstract::removeAll()
Removes all of the specified values from the collection

Implementation of:
Xyster_Collection_Interface::removeAll()
Removes all of the specified values from the collection

Redefined in descendants as:
removeAt (line 210)

Removes a value at the specified index

This method is an alias to ArrayAccess::offsetUnset

The index must be greater than or equal to 0 and less than the size of this collection. In other words, an index is valid if

  1. $index || $index $this->count() )
is false.

  • throws: OutOfBoundsException if the index is invalid
  • access: public
void removeAt (int $index)
  • int $index: The index to "unset"

Implementation of:
Xyster_Collection_List_Interface::removeAt()
Removes a value at the specified index
retainAll (line 223)

Removes all values from the collection except for the ones specified

{@inherit}

  • return: Whether the collection changed as a result of this method
  • access: public
boolean retainAll (Xyster_Collection_Interface $values)

Redefinition of:
Xyster_Collection_Abstract::retainAll()
Removes all values from the collection except for the ones specified

Implementation of:
Xyster_Collection_Interface::retainAll()
Removes all values from the collection except for the ones specified

Redefined in descendants as:
set (line 245)

Sets the value at a given index.

This method is an alias to ArrayAccess::offsetSet.

The index must be greater than or equal to 0 and less than the size of this collection. In other words, an index is valid if

  1. $index || $index $this->count() )
is false.

  • throws: OutOfBoundsException if the index is invalid
  • access: public
void set (int $index, mixed $value)
  • int $index: The index to set
  • mixed $value: The value to set

Implementation of:
Xyster_Collection_List_Interface::set()
Sets the value at a given index.
slice (line 257)

Removes $count elements starting at $from

  • throws: OutOfBoundsException if $from is invalid
  • access: public
void slice (int $from, int $count)
  • int $from: The starting index
  • int $count: The number of elements to remove

Implementation of:
Xyster_Collection_List_Interface::slice()
Removes all elements between $from and $to, including $from.

Redefined in descendants as:

Inherited Methods

Inherited From Xyster_Collection_Abstract

Xyster_Collection_Abstract::add()
Xyster_Collection_Abstract::clear()
Xyster_Collection_Abstract::contains()
Xyster_Collection_Abstract::containsAll()
Xyster_Collection_Abstract::containsAny()
Xyster_Collection_Abstract::count()
Xyster_Collection_Abstract::getIterator()
Xyster_Collection_Abstract::isEmpty()
Xyster_Collection_Abstract::merge()
Xyster_Collection_Abstract::remove()
Xyster_Collection_Abstract::removeAll()
Xyster_Collection_Abstract::retainAll()
Xyster_Collection_Abstract::toArray()
Xyster_Collection_Abstract::__toString()

Documentation generated on Mon, 19 May 2008 17:06:49 -0400 by phpDocumentor 1.4.2