Class Xyster_Collection_Map

Description

Implementation of a key-based collection

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

Located in /Collection/Map.php (line 35)

Xyster_Collection_Map_Abstract
   |
   --Xyster_Collection_Map
Variable Summary
array $_items
Method Summary
Xyster_Collection_Map __construct ([Xyster_Collection_Map_Interface $map = null], [boolean $immutable = false])
void clear ()
int count ()
Iterator getIterator ()
mixed keyFor (mixed $value)
boolean offsetExists (object $key)
mixed offsetGet (object $key)
void offsetSet (object $key, mixed $value)
void offsetUnset (object $key)
array toArray ()
Variables
array $_items = array() (line 42)

The container for the Xyster_Collection_Map_Entry objects

  • access: protected
Methods
Constructor __construct (line 57)

Creates a new map with object keys

  • access: public
Xyster_Collection_Map __construct ([Xyster_Collection_Map_Interface $map = null], [boolean $immutable = false])
clear (line 70)

Removes all items from the map

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

Gets the number of items in the map

  • return: The number of items
  • access: public
int count ()
getIterator (line 91)

Gets an iterator for the keys and values in this set

  • access: public
Iterator getIterator ()
keyFor (line 121)

Gets the first key found for the value supplied

This method could return null if the key is null, or if the key was not found. Use containsKey to check which is true.

  • return: The key found, or false if none
  • access: public
mixed keyFor (mixed $value)
  • mixed $value
keys (line 102)

Gets all keys contained in this map

  • return: The keys in this map
  • access: public
keysFor (line 137)

Gets all keys for the value supplied

  • access: public
Xyster_Collection_Set_Interface keysFor (mixed $value)
  • mixed $value: The value for which to search
offsetExists (line 155)

Gets whether the specified key exists in the map

  • return: Whether the key is in the map
  • throws: Xyster_Collection_Exception if the key type is incorrect
  • access: public
boolean offsetExists (object $key)
  • object $key: The key to test
offsetGet (line 167)

Gets the value at a specified key

  • return: The value found at $key or null if none
  • access: public
mixed offsetGet (object $key)
  • object $key: The index to get
offsetSet (line 180)

Sets the value at a given key.

  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • access: public
void offsetSet (object $key, mixed $value)
  • object $key: The key to set
  • mixed $value: The value to set
offsetUnset (line 199)

Removes a value at the specified key

  • throws: Xyster_Collection_Exception if the collection cannot be modified
  • access: public
void offsetUnset (object $key)
  • object $key: The key to "unset"
toArray (line 214)

Puts the items in this map into an array

This array contains objects with the key and value available.

  • return: The items in this map
  • access: public
array toArray ()
values (line 224)

Gets the values contained in this map

  • access: public

Inherited Methods

Inherited From Xyster_Collection_Map_Abstract

Xyster_Collection_Map_Abstract::containsKey()
Xyster_Collection_Map_Abstract::containsValue()
Xyster_Collection_Map_Abstract::get()
Xyster_Collection_Map_Abstract::isEmpty()
Xyster_Collection_Map_Abstract::merge()
Xyster_Collection_Map_Abstract::remove()
Xyster_Collection_Map_Abstract::set()

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