Interface Xyster_Collection_List_Interface

Description

Index-based collection

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

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

Countable
   |
   --Xyster_Collection_Interface
      |
      --Xyster_Collection_List_Interface
Method Summary
mixed get (int $index)
int indexOf (mixed $value)
void insert (int $index, mixed $value)
void insertAll (int $index, Xyster_Collection_Interface $values)
mixed removeAt (int $index)
void set (int $index, mixed $value)
void slice (int $from, int $to)
Methods
get (line 42)

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 count($list) )
is false.

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

Returns the first index found for the specified value

  • return: The first index found, or null if the value isn't contained
int indexOf (mixed $value)
  • mixed $value
insert (line 63)

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 count($list) )
is false.

  • throws: InvalidArgumentException if the collection cannot contain the value
  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • throws: OutOfBoundsException if the index is invalid
void insert (int $index, mixed $value)
  • int $index: The index at which to insert
  • mixed $value: The value to insert
insertAll (line 77)

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 count($list) )
is false.

  • throws: InvalidArgumentException if the collection cannot contain a value
  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • throws: OutOfBoundsException if the index is invalid
void insertAll (int $index, Xyster_Collection_Interface $values)
removeAt (line 92)

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 or equal to the size of this collection. In other words, an index is valid if

  1. $index || $index count($list) )
is false.

  • return: The value removed
  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • throws: OutOfBoundsException if the index is invalid
mixed removeAt (int $index)
  • int $index: The index to "unset"
set (line 108)

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 or equal to the size of this collection. In other words, an index is valid if

  1. $index || $index count($list) )
is false.

  • throws: InvalidArgumentException if the collection cannot contain the value
  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • throws: OutOfBoundsException if the index is invalid
void set (int $index, mixed $value)
  • int $index: The index to set
  • mixed $value: The value to set
slice (line 117)

Removes all elements between $from and $to, including $from.

  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • throws: OutOfBoundsException if either $from or $to is invalid
void slice (int $from, int $to)
  • int $from: The starting index
  • int $to: The index to end before reaching

Inherited Methods

Inherited From Xyster_Collection_Interface

Xyster_Collection_Interface::add()
Xyster_Collection_Interface::clear()
Xyster_Collection_Interface::contains()
Xyster_Collection_Interface::containsAll()
Xyster_Collection_Interface::containsAny()
Xyster_Collection_Interface::isEmpty()
Xyster_Collection_Interface::merge()
Xyster_Collection_Interface::remove()
Xyster_Collection_Interface::removeAll()
Xyster_Collection_Interface::retainAll()
Xyster_Collection_Interface::toArray()

Documentation generated on Mon, 19 May 2008 17:07:22 -0400 by phpDocumentor 1.4.2