PHP Class nspl\ds\Set

Inheritance: extends Collection
Afficher le fichier Open project: ihor/Nspl Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( )
__toString ( ) : string
add ( mixed $element )
clear ( )
contains ( mixed $element ) : boolean
copy ( ) : Set
delete ( mixed $element ) : boolean
difference ( Set | array | Traversable $sequence ) : Set
fromArray ( array $array ) : static
intersection ( Set | array | Traversable $sequence ) : Set
isEmpty ( ) : boolean
isSubset ( Set | array | Traversable $sequence ) : boolean
isSuperset ( Set | array | Traversable $sequence ) : boolean
key ( ) : mixed (PHP 5 >= 5.0.0)
Return the key of the current element
offsetExists ( mixed $index ) : boolean (PHP 5 >= 5.0.0)
Whether a offset exists
offsetGet ( integer $index ) : mixed (PHP 5 >= 5.0.0)
Offset to retrieve
offsetSet ( integer $index, mixed $value ) : void (PHP 5 >= 5.0.0)
Offset to set
offsetUnset ( integer $index ) : void (PHP 5 >= 5.0.0)
Offset to unset
toArray ( ) : array
union ( Set | array | Traversable $sequence ) : Set
update ( array | Traversable $sequence1 )

Méthodes protégées

Méthode Description
getElementKey ( mixed $element ) : integer | string

Method Details

__construct() public méthode

public __construct ( )

__toString() public méthode

public __toString ( ) : string
Résultat string

add() public méthode

public add ( mixed $element )
$element mixed

clear() public méthode

public clear ( )

contains() public méthode

public contains ( mixed $element ) : boolean
$element mixed
Résultat boolean

copy() public méthode

public copy ( ) : Set
Résultat Set

delete() public méthode

public delete ( mixed $element ) : boolean
$element mixed
Résultat boolean

difference() public méthode

public difference ( Set | array | Traversable $sequence ) : Set
$sequence Set | array | Traversable
Résultat Set

fromArray() public static méthode

public static fromArray ( array $array ) : static
$array array
Résultat static

getElementKey() protected static méthode

protected static getElementKey ( mixed $element ) : integer | string
$element mixed
Résultat integer | string

intersection() public méthode

public intersection ( Set | array | Traversable $sequence ) : Set
$sequence Set | array | Traversable
Résultat Set

isEmpty() public méthode

public isEmpty ( ) : boolean
Résultat boolean

isSubset() public méthode

public isSubset ( Set | array | Traversable $sequence ) : boolean
$sequence Set | array | Traversable
Résultat boolean

isSuperset() public méthode

public isSuperset ( Set | array | Traversable $sequence ) : boolean
$sequence Set | array | Traversable
Résultat boolean

key() public méthode

(PHP 5 >= 5.0.0)
Return the key of the current element
public key ( ) : mixed
Résultat mixed scalar on success, or null on failure.

offsetExists() public méthode

(PHP 5 >= 5.0.0)
Whether a offset exists
public offsetExists ( mixed $index ) : boolean
$index mixed

An offset to check for.

Résultat boolean true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

offsetGet() public méthode

(PHP 5 >= 5.0.0)
Offset to retrieve
public offsetGet ( integer $index ) : mixed
$index integer

The offset to retrieve.

Résultat mixed Can return all value types.

offsetSet() public méthode

(PHP 5 >= 5.0.0)
Offset to set
public offsetSet ( integer $index, mixed $value ) : void
$index integer

The offset to assign the value to.

$value mixed

The value to set.

Résultat void

offsetUnset() public méthode

(PHP 5 >= 5.0.0)
Offset to unset
public offsetUnset ( integer $index ) : void
$index integer

The offset to unset.

Résultat void

toArray() public méthode

public toArray ( ) : array
Résultat array

union() public méthode

public union ( Set | array | Traversable $sequence ) : Set
$sequence Set | array | Traversable
Résultat Set

update() public méthode

public update ( array | Traversable $sequence1 )
$sequence1 array | Traversable