Class Xyster_Collection_Map_Abstract

Description

Implements interfaces:

Abstract class for key-based collections

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

Located in /Collection/Map/Abstract.php (line 27)


	
			
Direct descendents
Class Description
Xyster_Collection_Map Implementation of a key-based collection
Xyster_Collection_Map_String A simple string key-based map
Method Summary
boolean containsKey (mixed $key)
boolean containsValue (mixed $item)
mixed get (mixed $key)
boolean isEmpty ()
void remove (mixed $key)
void set (mixed $key, mixed $value)
Methods
containsKey (line 40)

Tests to see whether the map contains the key supplied

If the supplied value is an object, and the map allows objects as keys, the comparison will be done for identity (===) and not for value (==).

This method is an alias to ArrayAccess::offsetExists

  • return: Whether the map contains the supplied key
  • access: public
boolean containsKey (mixed $key)
  • mixed $key: The key to test

Implementation of:
Xyster_Collection_Map_Interface::containsKey()
Tests to see whether the map contains the key supplied
containsValue (line 54)

Tests to see whether the map contains the value supplied

If the supplied value is an object, the comparison will be done for identity (===) and not for value (==).

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

Implementation of:
Xyster_Collection_Map_Interface::containsValue()
Tests to see whether the map contains the value supplied

Redefined in descendants as:
get (line 73)

Gets the value corresponding to the supplied key

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

  • return: The value found, or null if none
  • access: public
mixed get (mixed $key)
  • mixed $key

Implementation of:
Xyster_Collection_Map_Interface::get()
Gets the value corresponding to the supplied key
isEmpty (line 86)

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_Map_Interface::isEmpty()
Tests to see if the collection contains no elements
merge (line 100)

Combines this map with the supplied map

The values in the supplied map will take precedence if this map and the supplied map have duplicate keys.

  • return: Whether the map changed as a result of this method
  • access: public
boolean merge (Xyster_Collection_Map_Interface $map)
  • Xyster_Map_Interface $map

Implementation of:
Xyster_Collection_Map_Interface::merge()
Combines this map with the supplied map
remove (line 126)

Removes the mapping for the specified key

This method is an alias to ArrayAccess::offsetUnset

  • access: public
void remove (mixed $key)
  • mixed $key

Implementation of:
Xyster_Collection_Map_Interface::remove()
Removes the mapping for the specified key
set (line 139)

Sets a mapping for the key and value supplied

This method is an alias to ArrayAccess::offsetSet

  • access: public
void set (mixed $key, mixed $value)
  • mixed $key
  • mixed $value

Implementation of:
Xyster_Collection_Map_Interface::set()
Sets a mapping for the key and value supplied

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