Fruit DSKit
Common data structures for Fruit framework
 All Data Structures Namespaces Files Functions
Public Member Functions
Bijection Class Reference
Inheritance diagram for Bijection:
Collection

Public Member Functions

 __construct ()
 
 set ($k, $v)
 set mapping relation, no-op if not one-to-one and onto More...
 
 remove ($k)
 remove a mapping relation by key, no-op if not exist More...
 
 get ($k)
 get value by key More...
 
 has ($k)
 detect if key exists More...
 
 getv ($v)
 get key by value More...
 
 hasv ($v)
 detect if value exists More...
 
 removev ($v)
 remove a mapping relation by value, no-op if not exist More...
 
 len ()
 size of the collection More...
 
 toArray ()
 convert to array More...
 
 iterator ()
 

Detailed Description

Mapping data represents a bijective function.

Bijection guarantees the stored data are mapped one-to-one and onto. In other words, every key maps to a distinct value, and vice versa.

Definition at line 12 of file Bijection.php.

Constructor & Destructor Documentation

__construct ( )

Definition at line 18 of file Bijection.php.

Member Function Documentation

get (   $k)

get value by key

Definition at line 52 of file Bijection.php.

getv (   $v)

get key by value

Definition at line 66 of file Bijection.php.

has (   $k)

detect if key exists

Definition at line 60 of file Bijection.php.

hasv (   $v)

detect if value exists

Definition at line 74 of file Bijection.php.

iterator ( )

Returns an iterator to iterate this collection

Implements Collection.

Definition at line 101 of file Bijection.php.

len ( )

size of the collection

Implements Collection.

Definition at line 91 of file Bijection.php.

remove (   $k)

remove a mapping relation by key, no-op if not exist

Definition at line 40 of file Bijection.php.

removev (   $v)

remove a mapping relation by value, no-op if not exist

Definition at line 80 of file Bijection.php.

set (   $k,
  $v 
)

set mapping relation, no-op if not one-to-one and onto

Definition at line 25 of file Bijection.php.

toArray ( )

convert to array

Implements Collection.

Definition at line 96 of file Bijection.php.


The documentation for this class was generated from the following file: