Class Xyster_Collection_List_Empty

Description

Implements interfaces:

An immutable empty list

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

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


	
			
Method Summary
boolean add (mixed $item)
void clear ()
boolean contains (mixed $item)
int count ()
mixed get (int $index)
Iterator getIterator ()
int indexOf (mixed $value)
void insert (int $index, mixed $value)
void insertAll (int $index, Xyster_Collection_Interface $values)
boolean isEmpty ()
boolean merge (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 $to)
array toArray ()
void _immutable ()
Methods
add (line 36)

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

Implementation of:
Xyster_Collection_Interface::add()
Adds an item to the collection
clear (line 46)

Removes all items from the collection

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

Implementation of:
Xyster_Collection_Interface::clear()
Removes all items from the collection
contains (line 57)

Tests to see whether the collection contains the value supplied

  • return: Whether the collection contains the supplied value
  • access: public
boolean contains (mixed $item)
  • mixed $item: The item to test

Implementation of:
Xyster_Collection_Interface::contains()
Tests to see whether the collection contains the value supplied
containsAll (line 68)

Tests to see whether the collection contains all of the supplied values

  • return: Whether the collection contains all of the supplied values
  • access: public
boolean containsAll (Xyster_Collection_Interface $values)

Implementation of:
Xyster_Collection_Interface::containsAll()
Tests to see whether the collection contains all of the supplied values
containsAny (line 82)

Tests to see whether the collection contains any of the supplied values

Basically, implementations can safely return true on the first item that is found.

  • return: Whether the collection contains any of the supplied values
  • access: public
boolean containsAny (Xyster_Collection_Interface $values)

Implementation of:
Xyster_Collection_Interface::containsAny()
Tests to see whether the collection contains any of the supplied values
count (line 92)

Gets the number of items in the collection

  • return: The number of items
  • access: public
int count ()
get (line 105)

Gets the value at a specified index

This method is an alias to ArrayAccess::offsetGet

  • return: The value found at $index
  • 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
getIterator (line 116)

Gets an iterator for the values in the collection

  • access: public
Iterator getIterator ()
indexOf (line 127)

Returns the first index found for the specified value

  • return: The first index found, or null 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 139)

Inserts a value into the list at the specified index

  • 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

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

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: Xyster_Collection_Exception if the collection cannot be modified
  • 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
isEmpty (line 168)

Tests to see if the collection contains no elements

The return value from this method should be equivalent to

  1. $collection->count(== )
.

  • return: Whether this collection has no elements
  • access: public
boolean isEmpty ()

Implementation of:
Xyster_Collection_Interface::isEmpty()
Tests to see if the collection contains no elements
merge (line 180)

Merges the values from the supplied collection into this one

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

Implementation of:
Xyster_Collection_Interface::merge()
Merges the values from the supplied collection into this one
offsetExists (line 191)

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 203)

Gets the value at a specified index

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

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
offsetUnset (line 234)

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.

  • access: public
void offsetUnset (int $index)
  • int $index: The index to "unset"
remove (line 246)

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

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

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)

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

Removes a value at the specified index

This method is an alias to ArrayAccess::offsetUnset

  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • 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 286)

Removes all values from the collection except for the ones specified

If the collection doesn't contain any of the values supplied, it should simply be emptied.

  • 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)

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

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: Xyster_Collection_Exception if the collection cannot be modified
  • 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 316)

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

  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • access: public
void slice (int $from, int $to)
  • int $from: The starting index
  • int $to: The index to end before reaching

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

Puts the items in this collection into an array

  • return: The items in this collection
  • access: public
array toArray ()

Implementation of:
Xyster_Collection_Interface::toArray()
Puts the items in this collection into an array
_immutable (line 336)

Throws an exception

  • throws: Xyster_Collection_Exception always
  • access: protected
void _immutable ()

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