Class Xyster_Collection_List

Description

Simple implementation of an index-based collection

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

Located in /Collection/List.php (line 27)

Xyster_Collection_Abstract
   |
   --Xyster_Collection_List_Abstract
      |
      --Xyster_Collection_List
Method Summary
Xyster_Collection_List __construct ([Xyster_Collection_Interface $values = null], [boolean $immutable = null])
boolean add (mixed $item)
void clear ()
void insert (int $index, mixed $value)
void insertAll (int $index, Xyster_Collection_Interface $values)
void offsetSet (int $index, mixed $value)
void offsetUnset (int $index)
boolean remove (mixed $item)
void slice (int $from, int $count)
Variables
Methods
Constructor __construct (line 37)

Creates a new list

  • access: public
Xyster_Collection_List __construct ([Xyster_Collection_Interface $values = null], [boolean $immutable = null])
add (line 52)

Adds an item to the collection

  • return: Whether the collection changed as a result of this method
  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • access: public
boolean add (mixed $item)
  • mixed $item: The item to add

Redefinition of:
Xyster_Collection_Abstract::add()
Adds an item to the collection
clear (line 63)

Removes all items from the collection

  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • access: public
void clear ()

Redefinition of:
Xyster_Collection_Abstract::clear()
Removes all items from the collection
insert (line 79)

Inserts a value into the list at the specified index

{@inherit}

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

Redefinition of:
Xyster_Collection_List_Abstract::insert()
Inserts a value into the list at the specified index
insertAll (line 95)

Inserts the supplied values into the list at the specified index

{@inherit}

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

Redefinition of:
Xyster_Collection_List_Abstract::insertAll()
Inserts the supplied values into the list at the specified index
offsetSet (line 113)

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
  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • access: public
void offsetSet (int $index, mixed $value)
  • int $index: The index to set
  • mixed $value: The value to set

Redefinition of:
Xyster_Collection_List_Abstract::offsetSet()
Sets the value at a given index.
offsetUnset (line 128)

Removes a value at the specified index

{@inherit}

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

Redefinition of:
Xyster_Collection_List_Abstract::offsetUnset()
Removes a value at the specified index
remove (line 141)

Removes the specified value from the collection

  • return: If the value was in the collection
  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • access: public
boolean remove (mixed $item)
  • mixed $item: The value to remove

Redefinition of:
Xyster_Collection_List_Abstract::remove()
Removes the specified value from the collection
removeAll (line 154)

Removes all of the specified values from the collection

  • return: Whether the collection changed as a result of this method
  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • access: public
boolean removeAll (Xyster_Collection_Interface $values)

Redefinition of:
Xyster_Collection_List_Abstract::removeAll()
Removes all of the specified values from the collection
retainAll (line 167)

Removes all values from the collection except for the ones specified

  • return: Whether the collection changed as a result of this method
  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • access: public
boolean retainAll (Xyster_Collection_Interface $values)

Redefinition of:
Xyster_Collection_List_Abstract::retainAll()
Removes all values from the collection except for the ones specified
slice (line 181)

Removes $count elements starting at $from

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

Redefinition of:
Xyster_Collection_List_Abstract::slice()
Removes $count elements starting at $from

Inherited Methods

Inherited From Xyster_Collection_List_Abstract

Xyster_Collection_List_Abstract::get()
Xyster_Collection_List_Abstract::indexOf()
Xyster_Collection_List_Abstract::insert()
Xyster_Collection_List_Abstract::insertAll()
Xyster_Collection_List_Abstract::offsetExists()
Xyster_Collection_List_Abstract::offsetGet()
Xyster_Collection_List_Abstract::offsetSet()
Xyster_Collection_List_Abstract::offsetUnset()
Xyster_Collection_List_Abstract::remove()
Xyster_Collection_List_Abstract::removeAll()
Xyster_Collection_List_Abstract::removeAt()
Xyster_Collection_List_Abstract::retainAll()
Xyster_Collection_List_Abstract::set()
Xyster_Collection_List_Abstract::slice()

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:07:25 -0400 by phpDocumentor 1.4.2