![]() |
BTree Extras | ||||
BTree Extras Home | Read Only Sample Application | J2ME MIDP Sample Application | J2ME Palm Sample Application | Other Products |
Two sample applications are provided with this distribution which illustrate the functionality of the BTrees supplied as read only extensions to Virtual Machinery's BTree Product. The two demo applications are identical in their appearance the only being that one uses an instance of the com.virtualmachinery.btreero.btree.BTreeRO class and the other uses an instance of the com.virtualmachinery.btreero.btree.BTreeROInMem class. The demo classes can be found in the com.virtualmachinery.btreero.demo package. In order to run these demos you will need to have installed both the BTree Extras classes and the original Virtual Machinery BTree distribution. If you are using the JDK the classes can be compiled from the command line using the compilerodemos.bat batch file supplied in the ..code\java directory of the release. Two other files in this directory runrodemo.bat and runroinmemdemo.bat can be used to run the demos. These demos use the TESTRO BTree and the files associated with that (TESTRO.DAT and TESTRO.IND) can be found in the 'Sample BTrees' directory of the distribution - these files must be placed where they are visible to the demo applications e.g. in the same directory as the applications are started from.
When either of these demos is started you will see the following screen -
The data associated with this key will then be displayed in the Data text box. As you can see the data associated with this key is 'DYLAN'.
The demos allow you to view data from a Read Only BTree. You can enter the key for the piece of data that you want to show in the Index text entry box.In this case we have entered the text 'BOB'. Then press the 'Get' key at the bottom right of the screen.
You can also list all the indices that start with a particular string by entering the start text in the 'Indices starting with..' text box then press the 'Refresh List' button. All the indices starting with that string will be displayed in the 'Indices' box below. Selecting an index in the list will show the index and the associated data in the 'Index' and 'Data' text boxes of the application.