The Java string classes, String and StringBuffer, lie at the extremes of a spectrum (immutable, reference-based and mutable, content-based). Analogously, available text-search methods on string classes are implemented either as trivial, brute-force double loops, or as very sophisticated and resource-consuming regular-expression search methods. Motivated by our experience in data-intensive text applications, we propose a new string class, MutableString, which tries to get the right balance between extremes in both cases. Mutable strings can be in one of two states, compact and loose, in which they behave more like String and StringBuffer, respectively. Moreover, they support a wide range sophisticated text-search algorithms with a very low resource usage and setup time, using a new, very simple randomised data structure (a generalisation of Bloom filters) that stores an approximation from above of a lattice-valued function. Computing the function value requires a constant number of steps, and the error probability can be balanced with space usage. As a result, we obtain practical implementations of Boyer-Moore type algorithms that can be used with very large alphabets, such as Unicode collation elements. The techniques we develop are very general and amenable to a wide range of applications.
Mutable strings in Java: design, implementation and lightweight text-search algorithms / P. Boldi, S. Vigna. - In: SCIENCE OF COMPUTER PROGRAMMING. - ISSN 0167-6423. - 54:1(2005), pp. 3-23.
|Titolo:||Mutable strings in Java: design, implementation and lightweight text-search algorithms|
BOLDI, PAOLO (Primo)
VIGNA, SEBASTIANO (Ultimo)
|Settore Scientifico Disciplinare:||Settore INF/01 - Informatica|
|Data di pubblicazione:||2005|
|Digital Object Identifier (DOI):||http://dx.doi.org/10.1016/j.scico.2004.05.003|
|Appare nelle tipologie:||01 - Articolo su periodico|