Class HashMap

Description

Implements interfaces:

  • IteratorAggregate (internal interface)

HashMap实现类

Located in /ORG/Util/HashMap.class.php (line 24)

Base
   |
   --HashMap
Variable Summary
array $_values
Method Summary
HashMap __construct ([string $values = array()])
void clear ()
boolen contains (string $key, string $value)
boolen containsKey (string $key)
boolen containsValue (string $value)
mixed get (string $key)
Iterate getIterator ()
boolen isEmpty ()
array keySet ()
mixed put (string $key, string $value)
void putAll (array $values)
string remove (mixed $key)
integer size ()
array toArray ()
array values ()
Variables
array $_values = array() (line 35)

元素集数组

  • access: protected
Methods
Constructor __construct (line 46)

架构函数

  • access: public
HashMap __construct ([string $values = array()])
  • string $values: 初始化数组元素
clear (line 74)

清除Map数据

  • access: public
void clear ()
contains (line 123)

Map中是否包含指定的key和对应的value

  • access: public
boolen contains (string $key, string $value)
  • string $key: 键名
  • string $value: 键值
containsKey (line 90)

检查Map中是否指定key

  • access: public
boolen containsKey (string $key)
  • string $key: 键名
containsValue (line 106)

Map是否包含指定value

  • access: public
boolen containsValue (string $value)
  • string $value: 键值
get (line 143)

根据Key取得Map中的value

  • access: public
mixed get (string $key)
  • string $key: 键名
getIterator (line 62)

获取Iterator因子

  • access: public
Iterate getIterator ()

Implementation of:
IteratorAggregate::getIterator
isEmpty (line 161)

Map是否为空

  • access: public
boolen isEmpty ()
keySet (line 189)

返回Map中的key数组

  • access: public
array keySet ()
put (line 207)

放入指定的Key和value到Map,如果存在同名键名,则覆盖

如果存在的话返回之前的值

  • access: public
mixed put (string $key, string $value)
  • string $key: 键名
  • string $value: 键值
putAll (line 231)

批量放入values到Map

  • access: public
void putAll (array $values)
  • array $values: 数组
remove (line 252)

移出Map中指定的键名value

返回移除的值

  • access: public
string remove (mixed $key)
  • mixed $key: 键名
size (line 268)

取得Map对象的长度

  • access: public
integer size ()
toArray (line 175)

Map对象转换为数组

  • access: public
array toArray ()
values (line 282)

返回Map中的value数组

  • access: public
array values ()

Documentation generated on Thu, 27 Mar 2008 08:20:44 +0000 by 塞北的雪