
Public Member Functions | |
| __construct ($collection=array()) | |
| Constructor. | |
| setKeysAndValues ($keys, $values) | |
| getAnyKey () | |
| getRandomKey () | |
| getKeys () | |
| getValues () | |
| add ($key, $value) | |
| remove ($key) | |
| removeMultiple (array $keys) | |
| extract ($keys) | |
| intersect (spunQ_Map $otherMap) | |
| equals (spunQ_Map $otherMap) | |
| isEmpty () | |
| & | get ($key) |
| & | getByKey ($key) |
| & | getByValue ($value) |
| getAllKeysByValue ($value) | |
| getPairs () | |
| getSize () | |
| toAssociativeArray () | |
| keyExists ($key) | |
| valueExists ($value) | |
| copyFrom (spunQ_Map $otherMap) | |
| clear () | |
| rewind () | |
| Rewinds the internal iterator. | |
| valid () | |
| Checks whether the internal iterator points to a valid position. | |
| current () | |
| Returns the value references by the internal iterator. | |
| key () | |
| Returns the key references by the internal iterator. | |
| next () | |
| Increments the internal iterator. | |
| offsetExists ($key) | |
| Alias for keyExists(). | |
| offsetGet ($key) | |
| Alias for getByKey(). | |
| offsetSet ($key, $val) | |
| Alias for add(). | |
| offsetUnset ($key) | |
| Alias for remove(). | |
Static Public Member Functions | |
| static | emptyMap () |
| Returns an empty read-only map. | |
Private Attributes | |
| $keys = array() | |
| The keys that have been defined. | |
| $values = array() | |
| Values of the keys. | |
| $iteratorIndex = 0 | |
| Index for the iterator interface. | |
Static Private Attributes | |
| static | $emptyMap |
| An empty spunQ_ReadonlyMap instance. | |
This class is required since associative arrays in php can only contain numeric or string values as keys.
Definition at line 10 of file Map.class.php.
| spunQ_Map::__construct | ( | $ | collection = array() |
) |
Constructor.
| $collection | Can optionally be initialized with an associative array or another map. |
Definition at line 52 of file Map.class.php.
| spunQ_Map::current | ( | ) |
Returns the value references by the internal iterator.
Definition at line 321 of file Map.class.php.
| static spunQ_Map::emptyMap | ( | ) | [static] |
Returns an empty read-only map.
Definition at line 22 of file Map.class.php.
| spunQ_Map::key | ( | ) |
Returns the key references by the internal iterator.
Definition at line 333 of file Map.class.php.
| spunQ_Map::next | ( | ) |
| spunQ_Map::rewind | ( | ) |
| spunQ_Map::valid | ( | ) |
Checks whether the internal iterator points to a valid position.
Definition at line 312 of file Map.class.php.
spunQ_Map::$emptyMap [static, private] |
An empty spunQ_ReadonlyMap instance.
Definition at line 16 of file Map.class.php.
spunQ_Map::$iteratorIndex = 0 [private] |
spunQ_Map::$keys = array() [private] |
spunQ_Map::$values = array() [private] |
1.5.9