Hi fopsters

I've just been working on changing FOText to work with a java.nio.CharBuffer 
(instead of a char[]).
So far, while refactoring this, I already noticed that this makes the related 
code much more compact on our side. Another small improvement is that 
TextLayoutManager no longer duplicates the FOText's character array, but simply 
shares the same array that is backing the FOText's CharBuffer (slight reduction 
of the memory footprint; could be a significant amount in large documents).

Now, while I'm at it, I'm wondering whether it would be a good idea to have 
FOText implement Java 1.4's java.lang.CharSequence interface. This would mean 
that FOText gets a few extra methods (charAt(), length() and subSequence()), 
allowing us to use it in other parts of the code in the same fashion as a 
String or StringBuffer. The toString() method would need to be altered to 
follow the  definition as specified in the API docs (i.e. only output the 
text-content).

Any opinions on this? (or more importantly: Any objections?)


Cheers

Andreas


Reply via email to