D
dterzis
Hi folks...
I have an application which needs to store variable-length strings (up
to 24 characters long) that must then be matched according to prefix.
That is, whenever a prefix is given, the application has to be able to
retrieve all stored strings that start with this prefix. Conversely,
the program has to be able to store strings in such a way, so that
prefix-based retrieving is fast and accurate (i.e., all relative
strings are located and retrieved). Doing this linearly is obviously
slow and inefficient.
So, what is the best way of implementing this functionality in J2SE 1.4
or later? Or, if there is no ready (preprogrammed) way of doing it
properly in the standard distribution, are you aware of any open source
implementation (e.g., tree or something similar)?
Thanks,
Dimitris
I have an application which needs to store variable-length strings (up
to 24 characters long) that must then be matched according to prefix.
That is, whenever a prefix is given, the application has to be able to
retrieve all stored strings that start with this prefix. Conversely,
the program has to be able to store strings in such a way, so that
prefix-based retrieving is fast and accurate (i.e., all relative
strings are located and retrieved). Doing this linearly is obviously
slow and inefficient.
So, what is the best way of implementing this functionality in J2SE 1.4
or later? Or, if there is no ready (preprogrammed) way of doing it
properly in the standard distribution, are you aware of any open source
implementation (e.g., tree or something similar)?
Thanks,
Dimitris