Sgss_Collection_Map_Interface 
Provides for associated collection

Description

Author:
Matsuda Shota
Copyright:
(c) 2007-2008 Matsuda Shota
License:
http://creativecommons.org/licenses/GPL/2.0/
Located in:
/Collection/Map/Interface.php (line 40)

Class overview

Methods

boolean clear ()

Removes all the keys and the associated values in this map

mixed|null get (mixed $key)

Returns the value associated with the specified key

boolean has (mixed $key)

Determines whether this map contains an association for the specified key

boolean hasAll (array|object $keys)

Determines whether this map contains all associations for the keys in the specified object

boolean hasAllValues (array|object $values)

Determines whether this map contains all the values in the specified object

boolean hasValue (mixed $value)

Determines whether this map contains the specified value

boolean isEmpty ()

Determines whether this map contains no association

boolean put (mixed $key, mixed $value)

Inserts or replaces the association for the specified key and value into this map

boolean putAll (array|object $map, array|object $t)

Inserts or replaces the associations for all the keys and values in the specified object into this map

boolean remove (mixed $key)

Removes the specified key and associated value from this map

boolean removeAll (array|object $keys)

Removes all the keys and associated values in the specified object from this map

boolean set (mixed $key, mixed $value)

Alias of put()

int size ()

Returns the number of associations between key and value in this map

array toArray ()

Converts this map to an associated array

array toKeyArray ()

Returns an array containing all the keys in this map

array toValueArray ()

Returns an array containing all the values in this map

mixed __get (mixed $name)
boolean __isset (mixed $name)
mixed __set (mixed $name, mixed $value)
void __unset (mixed $name)

Method detail

clear

Removes all the keys and the associated values in this map

Returns:
boolean -- True when the operation changed this map
Signature:
public boolean clear ()


get

Returns the value associated with the specified key

Parameters:
  • mixed $key

    Key associated with the value to be retrieved

Returns:
mixed|null -- Retrieved value or null if this map does not contain the key
Used by:
Sgss_Collection_Map_Abstract::offsetGet(), Sgss_Collection_Map_Abstract::__get()
Signature:
public mixed|null get (mixed $key)


has

Determines whether this map contains an association for the specified key

Parameters:
  • mixed $key

    Key to determine

Returns:
boolean -- True when this map contains an association for the specified key
Used by:
Sgss_Collection_Map_Abstract::offsetExists(), Sgss_Collection_Map_Abstract::hasAll(), Sgss_Collection_Map_Abstract::__isset()
Signature:
public boolean has (mixed $key)


hasAll

Determines whether this map contains all associations for the keys in the specified object

Parameters:
  • array|object $keys

    Object containing keys to determine

Returns:
boolean -- True when this map contains all values associated with the keys in the specified object
Signature:
public boolean hasAll (array|object $keys)


hasAllValues

Determines whether this map contains all the values in the specified object

Parameters:
  • array|object $values

    Object containing values to determine

Returns:
boolean -- True when this map contains all the values in the specified object
Signature:
public boolean hasAllValues (array|object $values)


hasValue

Determines whether this map contains the specified value

Parameters:
  • mixed $value

    Value to determine

Returns:
boolean -- True when this map contains the specified value
Used by:
Sgss_Collection_Map_Abstract::hasAllValues()
Signature:
public boolean hasValue (mixed $value)


isEmpty

Determines whether this map contains no association

Returns:
boolean -- True when this map contains no association
Signature:
public boolean isEmpty ()


put

Inserts or replaces the association for the specified key and value into this map

Parameters:
  • mixed $key

    Key to be inserted

  • mixed $value

    Value to be inserted or replaced

Returns:
boolean -- True when the operation changed this map
Used by:
Sgss_Collection_Map_Abstract::offsetSet(), Sgss_Collection_Map_Abstract::__set(), Sgss_Collection_Map_Abstract::set(), Sgss_Collection_Map_Abstract::putAll()
Signature:
public boolean put (mixed $key, mixed $value)


putAll

Inserts or replaces the associations for all the keys and values in the specified object into this map

Parameters:
  • array|object $t

    Object which contains keys and values to be inserted or replaced

  • $map
Returns:
boolean -- True when the operation changed this map
Signature:
public boolean putAll (array|object $map, array|object $t)


remove

Removes the specified key and associated value from this map

Parameters:
  • mixed $key

    Key to be removed

Returns:
boolean -- True when the operation changed this list
Used by:
Sgss_Collection_Map_Abstract::offsetUnset(), Sgss_Collection_Map_Abstract::removeAll(), Sgss_Collection_Map_Abstract::__unset()
Signature:
public boolean remove (mixed $key)


removeAll

Removes all the keys and associated values in the specified object from this map

Parameters:
  • array|object $keys

    Object containing keys to associated with the values to be removed

Returns:
boolean -- True when the operation changed this list
Signature:
public boolean removeAll (array|object $keys)


set

Alias of put()

Parameters:
  • mixed $key

    Key to be inserted

  • mixed $value

    Value to be inserted and associated with the key

Returns:
boolean -- True when the operation changed this map
Related subject:
Sgss_Collection_Map_Interface::put()
Signature:
public boolean set (mixed $key, mixed $value)


size

Returns the number of associations between key and value in this map

Returns:
int -- The number of associations in this map
Used by:
Sgss_Collection_Map_Abstract::count(), Sgss_Collection_Map_Abstract::isEmpty()
Signature:
public int size ()


toArray

Converts this map to an associated array

Returns:
array -- An associated array representing this map
Signature:
public array toArray ()


toKeyArray

Returns an array containing all the keys in this map

Returns:
array -- Array containing all the keys in this map
Signature:
public array toKeyArray ()


toValueArray

Returns an array containing all the values in this map

Returns:
array -- Array containing all the values in this map
Signature:
public array toValueArray ()


__get

Parameters:
  • mixed $name
Signature:
public mixed __get (mixed $name)


__isset

Parameters:
  • mixed $name
Signature:
public boolean __isset (mixed $name)


__set

Parameters:
  • mixed $name
  • mixed $value
Signature:
public mixed __set (mixed $name, mixed $value)


__unset

Parameters:
  • mixed $name
Signature:
public void __unset (mixed $name)