Judy
PHP Manual

Класс Judy

(PECL judy >= 0.1.1)

Введение

Класс Judy реализует интерфейсы ArrayAccess и Iterator. К этумо классу можно обращаться используя синтаксис массивов PHP.

Объект Judy (или Массив Judy) может быть одного из следующих типов:

Пример #1 Пример массива Judy

<?php
    $judy 
= new Judy(Judy::INT_TO_MIXED);
    
$judy[1] = "one";
    
$judy[2] = array('a''b''c');
    
$judy[3] = new Judy(Judy::BITSET);
?>

Обзор классов

Judy implements ArrayAccess , Iterator {
/* Константы */
const integer BITSET = 1 ;
const integer INT_TO_INT = 2 ;
const integer INT_TO_MIXED = 3 ;
const integer STRING_TO_INT = 4 ;
const integer STRING_TO_MIXED = 5 ;
/* Методы */
public int byCount ( int $nth_index )
public __construct ( int $judy_type )
public int count ([ int $index_start = 0 [, int $index_end = -1 ]] )
public void __destruct ( void )
public mixed first ([ mixed $index ] )
public int firstEmpty ([ mixed $index = 0 ] )
public int free ( void )
public int getType ( void )
public void last ([ string $index ] )
public int lastEmpty ([ int $index = -1 ] )
public int memoryUsage ( void )
public mixed next ( mixed $index )
public int nextEmpty ( int $index )
public bool offsetExists ( mixed $offset )
public mixed offsetGet ( mixed $offset )
public bool offsetSet ( mixed $offset , mixed $value )
public bool offsetUnset ( mixed $offset )
public mixed prev ( mixed $index )
public int prevEmpty ( mixed $index )
public void size ( void )
}

Предопределенные константы

Judy::BITSET

Определяет массив Judy как Bitset с ключами Integer и значениями Boolean.

Judy::INT_TO_INT

Определяет массив Judy как массив с ключами Integer и значениями Integer.

Judy::INT_TO_MIXED

Определяет массив Judy как массив с ключами Integer и значениями любого типа.

Judy::STRING_TO_INT

Определяет массив Judy как массив с ключами Integer и String и значениями Integer.

Judy::STRING_TO_MIXED

Определяет массив Judy как массив с ключами Integer и String и значениями любого типа.

Содержание


Judy
PHP Manual