Yii Framework v1.1.10 绫诲弬鑰

CMapIterator

system.collections
缁ф壙 class CMapIterator
瀹炵幇 Iterator, Traversable
婧愯嚜 1.0
鐗堟湰 $Id: CMapIterator.php 3186 2011-04-15 22:34:55Z alexander.makarow $
婧愮爜 framework/collections/CMapIterator.php
CMapIterator涓CMap瀹炵幇涓涓凯浠e櫒銆

瀹冨厑璁窩Map杩斿洖涓涓柊鐨勮凯浠e櫒鏉ラ亶鍘嗛泦鍚堥噷闈㈢殑椤圭洰銆

鍏叡鏂规硶

闅愯棌缁ф壙鏂规硶

鏂规硶鎻忚堪瀹氫箟鍦
__construct() 鏋勯犳柟娉 CMapIterator
current() 杩斿洖褰撳墠鏁扮粍鍏冪礌銆 CMapIterator
key() 杩斿洖褰撳墠鏁扮粍鍏冪礌鐨勯敭鍚嶃 CMapIterator
next() 绉诲姩褰撳墠绱㈠紩鍒颁笅涓涓厓绱犵殑浣嶇疆銆 CMapIterator
rewind() 閲嶇疆褰撳墠鏁扮粍绱㈠紩浣嶇疆銆 CMapIterator
valid() 杩斿洖鍊艰鏄庡綋鍓嶄綅缃槸鍚﹀瓨鍦ㄤ竴涓」鐩 CMapIterator

鏂规硶璇︾粏

__construct() 鏂规硶
public void __construct(array &$data)
$data array 瑕侀亶鍘嗙殑鏁版嵁
婧愮爜锛 framework/collections/CMapIterator.php#40 (鏄剧ず)
public function __construct(&$data)
{
    
$this->_d=&$data;
    
$this->_keys=array_keys($data);
    
$this->_key=reset($this->_keys);
}

鏋勯犳柟娉

current() 鏂规硶
public mixed current()
{return} mixed 杩斿洖褰撳墠鏁扮粍鍏冪礌
婧愮爜锛 framework/collections/CMapIterator.php#71 (鏄剧ず)
public function current()
{
    return 
$this->_d[$this->_key];
}

杩斿洖褰撳墠鏁扮粍鍏冪礌銆 姝ゆ柟娉曚负鎺ュ彛Iterator寮哄埗瑕佹眰瀹炵幇銆

key() 鏂规硶
public mixed key()
{return} mixed 杩斿洖褰撳墠鏁扮粍椤圭洰鐨勯敭鍚嶃
婧愮爜锛 framework/collections/CMapIterator.php#61 (鏄剧ず)
public function key()
{
    return 
$this->_key;
}

杩斿洖褰撳墠鏁扮粍鍏冪礌鐨勯敭鍚嶃 姝ゆ柟娉曚负鎺ュ彛Iterator寮哄埗瑕佹眰瀹炵幇銆

next() 鏂规硶
public void next()
婧愮爜锛 framework/collections/CMapIterator.php#80 (鏄剧ず)
public function next()
{
    
$this->_key=next($this->_keys);
}

绉诲姩褰撳墠绱㈠紩鍒颁笅涓涓厓绱犵殑浣嶇疆銆 姝ゆ柟娉曚负鎺ュ彛Iterator寮哄埗瑕佹眰瀹炵幇銆

rewind() 鏂规硶
public void rewind()
婧愮爜锛 framework/collections/CMapIterator.php#51 (鏄剧ず)
public function rewind()
{
    
$this->_key=reset($this->_keys);
}

閲嶇疆褰撳墠鏁扮粍绱㈠紩浣嶇疆銆 姝ゆ柟娉曚负鎺ュ彛Iterator寮哄埗瑕佹眰瀹炵幇銆

valid() 鏂规硶
public boolean valid()
{return} boolean
婧愮爜锛 framework/collections/CMapIterator.php#90 (鏄剧ず)
public function valid()
{
    return 
$this->_key!==false;
}

杩斿洖鍊艰鏄庡綋鍓嶄綅缃槸鍚﹀瓨鍦ㄤ竴涓」鐩 姝ゆ柟娉曚负鎺ュ彛Iterator寮哄埗瑕佹眰瀹炵幇銆

Copyright © 2008-2011 by Yii Software LLC
All Rights Reserved.