|
The nrio.BPlusTree class provides a platform-independent, disk-based implementation of B+Trees. You don't need to go through this page, if all you need is using B+Tree indexing on your (J)RXDbase databases, because the forementioned classes can already seamlessly handle B+Trees. On the other hand, if your own application needs disk-based B+Trees, this page is for you. The default return strings for the
methods presented below are: As of today the following methods are implemented:
nrio.BPlusTree BPlusTree(Rexx dir, Rexx fName, Rexx len, Rexx num) This is the only constructor available for the BPlusTree object. It creates two files, if necessary, and initializes the object. The two files are named dir+fName+other_chars.lix (for leaves) and dir+fName+other_chars.nix (for internal nodes). You can omit, or include, the platform dependent final path separator in the "dir" parameter. The parameters are: dir -- directory where this B+Tree will be
stored. Rexx add(Rexx item, Rexx index) This method adds an item to the B+Tree, specifying that its database position is 'index'. If you don't need the extra information provided by 'index', just pass whatever value you like for it. Rexx delete(Rexx item, Rexx index) This method deletes one item from the B+Tree. This method executes a query on the BPlusTree. Valid filter conditions are: Note: there must be one or more spaces between [operator] and [value]. The returned Rexx string is structured this
way: Returned elements represent the "index" parameter sent during the add operation, and are ordered alphabetically (not on the index, but on the item, as one would expect from a B+Tree). Rexx modify(Rexx oldItem, Rexx index, Rexx newItem) This method modifies one item from the B+Tree: oldItem, with the index 'index', becomes newItem. This method shuts down the B+Tree, doing all necessary cleanup. Call it before shutting down your application. Rexx thereIsAlready(Rexx item) This method looks for the presence of item 'item'. It returns '1' if the item is already present, '0' otherwise. This method returns '1' if it is possible to store more than one item with the same key value, '0' otherwise. This method returns the file name of the leaves file (complete with path information, in a machine-dependent format). This method returns the file name of the nodes file (complete with path information, in a machine-dependent format). This method returns the B+Tree status. setDuplicatesAllowed(Rexx allowed) Call with method with 'allowed' set to '1' if you
want to let the users store more than one item with the same key
value, '0' otherwise. |
Max
Marsiglietti © 1997
Layout and
artwork Andrea Resmini 1997