The Judy class
(PECL judy >= 0.1.1)
Introduction
The Judy class implements the ArrayAccess interface and the Iterator interface. This class, once instantiated, can be accessed like a PHP array.
A PHP Judy object (or Judy Array) can be one of the following type :
Example #1 Judy array example
<?php
$judy = new Judy(Judy::INT_TO_MIXED);
$judy[1] = "one";
$judy[2] = array('a', 'b', 'c');
$judy[3] = new Judy(Judy::BITSET);
?>
Class synopsis
Predefined Constants
Judy::BITSET
-
Define the Judy Array as a Bitset with keys as Integer and Values as a Boolean
Judy::INT_TO_INT
-
Define the Judy Array with key/values as Integer, and Integer only.
Judy::INT_TO_MIXED
-
Define the Judy Array with keys as Integer and Values of any type.
Judy::STRING_TO_INT
-
Define the Judy Array with keys as a String and Values as Integer, and Integer only.
Judy::STRING_TO_MIXED
-
Define the Judy Array with keys as a String and Values of any type.
Table of Contents
- Judy::byCount — Locate the Nth index present in the Judy array
- Judy::__construct — Construct a new Judy object
- Judy::count — Count the number of elements in the Judy array
- Judy::__destruct — Destruct a Judy object
- Judy::first — Search for the first index in the Judy array
- Judy::firstEmpty — Search for the first absent index in the Judy array
- Judy::free — Free the entire Judy array
- Judy::getType — Return the type of the current Judy array
- Judy::last — Search for the last index in the Judy array
- Judy::lastEmpty — Search for the last absent index in the Judy array
- Judy::memoryUsage — Return the memory used by the Judy array
- Judy::next — Search for the next index in the Judy array
- Judy::nextEmpty — Search for the next absent index in the Judy array
- Judy::offsetExists — Whether a offset exists
- Judy::offsetGet — Offset to retrieve
- Judy::offsetSet — Offset to set
- Judy::offsetUnset — Offset to unset
- Judy::prev — Search for the previous index in the Judy array
- Judy::prevEmpty — Search for the previous absent index in the Judy array
- Judy::size — Return the size of the current Judy array
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-class.judy.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.