Sign in Join
Wiki copytemporary

StringHashMap: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: StringHashMap

OldNewLine
1+### About
2+
3+StringHashMap is a string -\> pointer associative map container. It is implemented in a fast and memory efficient way. The search time of a hash map is constant, it does not depend on the amount of data (assuming there is enough memory and no swapping). Millions of elements is no problem.
4+
5+The unit name is StrHashMap.pas and it was modified from unit JclStrHashMap.pas which is part of Jcl library.
6+
7+The purpose was to make it compile and work with FPC (Free Pascal Compiler). In the process lots of code with conditional compilation directives was removed and also many unit dependencies were removed.
8+
9+The download contains:
10+
11+- Source unit file
12+- Comprehensive demo program which builds a database of South Park episodes and then searches them swiftly using a hash map lookup :-)
13+- README.txt file which basically tells you about this document and about the demo program.
14+
15+### Author
16+
17+Juha Manninen \<juha dot manninen (at) phnet dot fi\>
18+
19+\+ the original authors of Jcl code.
20+
21+### License
22+
23+This code is licensed under the same terms as Jcl library.
24+
25+### Download
26+
27+The latest stable release can be found on GitHub: <http://github.com/JuhaManninen/Pascal>
28+
29+There is a "Download Source" button available.
30+
31+### Change Log
32+
33+- Version 1.0 2009-11-25
34+
35+### Dependencies / System Requirements
36+
37+- None. Pure Pascal.
38+
39+Status: Stable
40+
41+Issues: It turned out there are about similar container classes in FPC's libraries so this one is not published in CCR. I published it in GitHub instead.
42+
43+### Installation
44+
45+Just include unit StrHashMap in the "uses" section. Set path for it in project settings if needed.
46+
47+### The HashMapDemo1 Example Application
48+
49+To install and run:
50+
51+- From Example directory open HashMapDemo1.lpi
52+- Build it
53+- Run it at console so that you can see the output.
54+- Inspect the source code based on the output.
55+
56+The example application first builds a database of South Park episodes and then demonstrates the following features of StringHashMap:
57+
58+- Search data records with lightning speed using hash keys.
59+- Array syntax: Map\[Key\]
60+- Find function: Map.Find(Key, Pointer)
61+- FindData function: Map.FindData(Pointer, Key)
62+- Iterating elements
63+- Using the data pointer as integer, making a very efficient word counter.
64+
65+### See also
66+
67+- [[Data Structures, Containers, Collections]] Overview of other hash list/data structure implementations
68+- [FreePascal hash maps comparsion](http://www.benibela.de/fpc-map-benchmark_en.html)
69+
70+---
71+*From the Free Pascal wiki, page "StringHashMap", as it stood on 2018-08-01 after a change by Serbod, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
72+Category: Containers

Back to history