This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gui] AbstractDocument.Content implementation


When someone gets around to implement the GapBuffer class
in javax.swing.text you might use my CharBuffer class,
which I used in JEmacs.

You probably want to rename soem of the classes, but
it does support the needed functionality (except undo).
It uses int "cookies" to implement positions, so higher-level
code can use these ints to implement Element without having
to allocate huge numbers of Position objects.  A Position is
just a simple class that has an int position cookie and
points to a CharBuffer.  The int cookies are not offsets;
they're indexes into an indirection table that is automatically
adjusted when characters are inserted or removed.

http://www.gnu.org/software/kawa/api/gnu/lists/CharBuffer.html
http://www.gnu.org/software/kawa/api/gnu/lists/StableVector.html
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]