HashTable
in package
\PhpOffice\PhpPresentation\HashTable.
Table of Contents
Properties
- $items : array<string, ComparableInterface>
- HashTable elements.
- $keyMap : array<int, string>
- HashTable key map.
Methods
- __construct() : mixed
- Create a new \PhpOffice\PhpPresentation\HashTable.
- add() : void
- Add HashTable item.
- addFromSource() : void
- Add HashTable items from source.
- clear() : void
- Clear HashTable.
- count() : int
- Count.
- getByHashCode() : ComparableInterface|null
- Get by hashcode.
- getByIndex() : ComparableInterface|null
- Get by index.
- getIndexForHashCode() : int
- Get index for hash code.
- remove() : void
- Remove HashTable item.
- toArray() : array<string|int, ComparableInterface>
- HashTable to array.
Properties
$items
HashTable elements.
public
array<string, ComparableInterface>
$items
= []
$keyMap
HashTable key map.
public
array<int, string>
$keyMap
= []
Methods
__construct()
Create a new \PhpOffice\PhpPresentation\HashTable.
public
__construct([array<int, ComparableInterface> $pSource = [] ]) : mixed
Parameters
- $pSource : array<int, ComparableInterface> = []
-
Optional source array to create HashTable from
add()
Add HashTable item.
public
add(ComparableInterface $pSource) : void
Parameters
- $pSource : ComparableInterface
-
Item to add
addFromSource()
Add HashTable items from source.
public
addFromSource([array<int, ComparableInterface> $pSource = [] ]) : void
Parameters
- $pSource : array<int, ComparableInterface> = []
-
Source array to create HashTable from
clear()
Clear HashTable.
public
clear() : void
count()
Count.
public
count() : int
Return values
intgetByHashCode()
Get by hashcode.
public
getByHashCode([string $pHashCode = '' ]) : ComparableInterface|null
Parameters
- $pHashCode : string = ''
Return values
ComparableInterface|nullgetByIndex()
Get by index.
public
getByIndex([int $pIndex = 0 ]) : ComparableInterface|null
Parameters
- $pIndex : int = 0
Return values
ComparableInterface|nullgetIndexForHashCode()
Get index for hash code.
public
getIndexForHashCode([string $pHashCode = '' ]) : int
Parameters
- $pHashCode : string = ''
Return values
int —Index (-1 if not found)
remove()
Remove HashTable item.
public
remove(ComparableInterface $pSource) : void
Parameters
- $pSource : ComparableInterface
-
Item to remove
toArray()
HashTable to array.
public
toArray() : array<string|int, ComparableInterface>