In-lined at the end ... G > From: Stephen Colebourne [mailto:[EMAIL PROTECTED] > Sent: Saturday, July 09, 2005 6:32 AM > To: Jakarta Commons Developers List > Subject: Re: [lang] text.Interpolation, on to 2.2 > > >> a) we don't have the ability to call it directly from StrBuilder > >> without copying the char array to a String. (VariableFormatter needs > >> rewriting to operate on a char[]) > > Hmmm. I've just realised that this won't work. VariableFormatter may > need to lengthen the array, and that isn't possible outside the > StrBuilder class (without horrible hacks). > > So, IMHO, we need to focus on StrBuilder again. StrBuilder is intended > as our mutable string. VariableFormatter can use a StrBuilder intenally. > > StrTokenizer doen't need to use StrBuilder as it doesn't change the > string. VariableFormatter does change the string, so should be built on > StrBuilder. > > > Oliver Heger wrote: > > I think, it shouldn't be a problem to implement the > > Matcher interface to locate variables in the source string. But I will > > have to study the StrTokenizer class whether it is possible to extract > > the variables' names once they have been detected. > > My point wrt StrTokenizer was that the Matcher interface *might* be > useful. However, on further reflection, I think it is best to keep the > two classes a bit more separate. We shouldn't force re-use.
I agree, and in this spirit I would want VariableFormatter to only use StrBuilder because it needs to, not because it is just there. Gary > Stephen --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
