PHP 인터페이스 Collections\DictionaryInterface

상속: extends IteratorAggregate, extends Countable
파일 보기 프로젝트 열기: danielgsims/php-collections

공개 메소드들

메소드 설명
add ( $key, $value ) : static Adds the key-value pair containing $key and $value to the dictionary.
clear ( ) : static Removes every key-value pair from the dictionary.
count ( ) : integer Returns the number of key-value pairs in the dictionary.
delete ( $key ) : static Removes the key-value pair represented by $key from the dictionary.
each ( callable $callable ) Applies the callback function $callable to each key-value pair in the dictionary.
exists ( $key ) : boolean Returns true if $key is in the dictionary, returns false if it is not.
filter ( callable $condition ) : static Returns a dictionary that only contains the key-value pairs which satisfy $condition.
get ( $key ) : mixed Returns the value associated with $key.
getKeyType ( ) : string Returns the type of the dictionary's keys.
getOrElse ( $key, $default ) : mixed Returns the value associated with $key in the dictionary, returns $default if it does not.
getValueType ( ) : string Returns the type of the dictionary's values.
keys ( ) : array Returns an array of all keys in the dictionary.
map ( callable $callable ) : static Returns a new dictionary with the callback function $callable applied to every key-value pair in the dictionary.
merge ( $newItems ) : static Adds every key-value pair in $newItems to the dictionary.
toArray ( ) : array Returns the key-value pairs in the dictionary as an associative array.
valueExists ( $value ) : boolean Returns true if $value is in the dictionary, returns false if not.
values ( ) : array Returns an array of all values in the dictionary.
without ( callable $condition ) : static Removes all key-value pairs from the Dictionary that do not satisfy $condition.

메소드 상세

add() 공개 메소드

Adds the key-value pair containing $key and $value to the dictionary.
public add ( $key, $value ) : static
$key
$value
리턴 static

clear() 공개 메소드

Removes every key-value pair from the dictionary.
public clear ( ) : static
리턴 static

count() 공개 메소드

Returns the number of key-value pairs in the dictionary.
public count ( ) : integer
리턴 integer

delete() 공개 메소드

Removes the key-value pair represented by $key from the dictionary.
public delete ( $key ) : static
$key
리턴 static

each() 공개 메소드

Applies the callback function $callable to each key-value pair in the dictionary.
public each ( callable $callable )
$callable callable

exists() 공개 메소드

Returns true if $key is in the dictionary, returns false if it is not.
public exists ( $key ) : boolean
$key
리턴 boolean

filter() 공개 메소드

Returns a dictionary that only contains the key-value pairs which satisfy $condition.
public filter ( callable $condition ) : static
$condition callable
리턴 static

get() 공개 메소드

Returns the value associated with $key.
public get ( $key ) : mixed
$key
리턴 mixed

getKeyType() 공개 메소드

Returns the type of the dictionary's keys.
public getKeyType ( ) : string
리턴 string

getOrElse() 공개 메소드

Returns the value associated with $key in the dictionary, returns $default if it does not.
public getOrElse ( $key, $default ) : mixed
$key
$default
리턴 mixed

getValueType() 공개 메소드

Returns the type of the dictionary's values.
public getValueType ( ) : string
리턴 string

keys() 공개 메소드

Returns an array of all keys in the dictionary.
public keys ( ) : array
리턴 array

map() 공개 메소드

Returns a new dictionary with the callback function $callable applied to every key-value pair in the dictionary.
public map ( callable $callable ) : static
$callable callable
리턴 static

merge() 공개 메소드

Adds every key-value pair in $newItems to the dictionary.
public merge ( $newItems ) : static
$newItems
리턴 static

toArray() 공개 메소드

Returns the key-value pairs in the dictionary as an associative array.
public toArray ( ) : array
리턴 array

valueExists() 공개 메소드

Returns true if $value is in the dictionary, returns false if not.
public valueExists ( $value ) : boolean
$value
리턴 boolean

values() 공개 메소드

Returns an array of all values in the dictionary.
public values ( ) : array
리턴 array

without() 공개 메소드

Removes all key-value pairs from the Dictionary that do not satisfy $condition.
public without ( callable $condition ) : static
$condition callable
리턴 static