DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27901>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27901

TextCharIterator.remove() does not work properly





------- Additional Comments From [EMAIL PROTECTED]  2004-03-26 07:55 -------
The advance if the LinkedList solution would be that remove/replace operations
would be very fast. It's only a replacement of two references, no arraycopy.

E.g.

a -> b -> c

is represented in the sun SDK implementation (only looked into 1.4.2)

a.previous = null
a.next = b
b.previous = a
b.next = c
c.previous = b
c.next = null

Removing b would be

a.next = c
c.previous = a

b is thrown away.

The drawback: Besides the LinkedList and its iterator which need to be
generated, further 2*chrarray.length objects (length Characters from
Arrays.asList + length internally from the LinkedList which generates
LinkedList.Entry instances) are needed.

If you prefer little construction overhead this is the wrong thing, if you focus
on fast removing/replacing I think this is the best solution.

Christian Z.

Reply via email to