Class Xyster_Collection_Map_String

Description

A simple string key-based map

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

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

Xyster_Collection_Map_Abstract
   |
   --Xyster_Collection_Map_String
Variable Summary
array $_items
Method Summary
Xyster_Collection_Map_String __construct ([Xyster_Collection_Map_Interface $map = null])
void clear ()
boolean containsValue (mixed $item)
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 34)

The map array

  • access: protected
Methods
Constructor __construct (line 41)

Creates a new map with object keys

  • access: public
Xyster_Collection_Map_String __construct ([Xyster_Collection_Map_Interface $map = null])
clear (line 52)

Removes all items from the map

  • access: public
void clear ()
containsValue (line 66)

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

Redefinition of:
Xyster_Collection_Map_Abstract::containsValue()
Tests to see whether the map contains the value supplied
count (line 76)

Gets the number of items in the map

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

Gets an iterator for the keys and values in this set

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

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

Gets all keys contained in this map

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

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

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

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

Sets the value at a given key.

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

Removes a value at the specified key

  • access: public
void offsetUnset (object $key)
  • object $key: The key to "unset"
toArray (line 195)

Puts the items in this collection into an array

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

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