It is generally recommended that the gap buffer or piece table implementations be used instead. This buffer does not scale up to large sizes.
Warning
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see java..
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | StringContent.
UnoableEdit created for inserts. |
| pack-priv static class | StringContent.
holds the data for a mark... |
| pack-priv class | StringContent.
UndoableEdit created for removes. |
| pack-priv class | |
| pack-priv static class | StringContent.
Used to hold a reference to a Position that is being reset as the result of removing from the content. |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private char[] | |
| private static final char[] | |
| pack-priv transient Vector |
| Access | Constructor and Description |
|---|---|
| public | |
| public | StringContent(int
the initial size initialLength)Creates a new StringContent object, with the initial size specified. |
| Modifier and Type | Method and Description |
|---|---|
| public Position | Returns: the positionthe offset to create a position for >= 0 offset)Implements javax. Creates a position within the content that will track change as the content is mutated. |
| public void | getChars(int
the starting position >= 0 where, int the number of characters to retrieve >= 0 len, Segment the Segment object to return the characters in chars)Implements javax. Retrieves a portion of the content. |
| protected Vector | Returns: the set of instancesthe Vector to use, with a new one created on null v, int the starting offset >= 0 offset, int the length >= 0 length)Returns a Vector containing instances of UndoPosRef for the
Positions in the range
|
| public String | Returns: a string representing the content; may be emptythe starting position >= 0 where, int the length to retrieve >= 0 len)Implements javax. Retrieves a portion of the content. |
| public UndoableEdit | Returns: an UndoableEdit object for undoingthe starting position >= 0 && < length() where, String the non-null string to insert str)Implements javax. Inserts a string into the content. |
| public int | Returns: the length >= 1Implements javax. Returns the length of the content. |
| public UndoableEdit | Returns: an UndoableEdit object for undoingthe starting position >= 0 where, int the number of characters to remove >= 0 nitems)Implements javax. Removes part of the content. |
| pack-priv void | replace(int
offset into the array to start the replace offset, int number of characters to remove length, char[] replacement array replArray, int offset into the replacement array replOffset, int number of character to use from the
replacement array. replLength)Replaces some of the characters in the array |
| pack-priv void | |
| pack-priv synchronized void | |
| pack-priv synchronized void | |
| protected void | updateUndoPositions(Vector<E>
the positions of the instances positions)Resets the location for all the UndoPosRef instances
in |
| count | back to summary |
|---|---|
| private int count | |
| data | back to summary |
|---|---|
| private char[] data | |
| empty | back to summary |
|---|---|
| private static final char[] empty | |
| marks | back to summary |
|---|---|
| pack-priv transient Vector<StringContent. | |
| StringContent | back to summary |
|---|---|
| public StringContent() Creates a new StringContent object. Initial size defaults to 10. | |
| StringContent | back to summary |
|---|---|
| public StringContent(int initialLength) Creates a new StringContent object, with the initial size specified. If the length is < 1, a size of 1 is used.
| |
| createPosition | back to summary |
|---|---|
| public Position createPosition(int offset) throws BadLocationException Implements javax. Creates a position within the content that will track change as the content is mutated.
| |
| getChars | back to summary |
|---|---|
| public void getChars(int where, int len, Segment chars) throws BadLocationException Implements javax. Retrieves a portion of the content. where + len must be <= length()
| |
| getPositionsInRange | back to summary |
|---|---|
| protected Vector Returns a Vector containing instances of UndoPosRef for the
Positions in the range
This is meant for internal usage, and is generally not of interest to subclasses.
| |
| getString | back to summary |
|---|---|
| public String getString(int where, int len) throws BadLocationException Implements javax. Retrieves a portion of the content. where + len must be <= length().
| |
| insertString | back to summary |
|---|---|
| public UndoableEdit insertString(int where, String str) throws BadLocationException Implements javax. Inserts a string into the content.
| |
| length | back to summary |
|---|---|
| public int length() Implements javax. Returns the length of the content.
| |
| remove | back to summary |
|---|---|
| public UndoableEdit remove(int where, int nitems) throws BadLocationException Implements javax. Removes part of the content. where + nitems must be < length().
| |
| replace | back to summary |
|---|---|
| pack-priv void replace(int offset, int length, char[] replArray, int replOffset, int replLength) Replaces some of the characters in the array
| |
| resize | back to summary |
|---|---|
| pack-priv void resize(int ncount) | |
| updateMarksForInsert | back to summary |
|---|---|
| pack-priv synchronized void updateMarksForInsert(int offset, int length) | |
| updateMarksForRemove | back to summary |
|---|---|
| pack-priv synchronized void updateMarksForRemove(int offset, int length) | |
| updateUndoPositions | back to summary |
|---|---|
| protected void updateUndoPositions(Vector<E> positions) Resets the location for all the UndoPosRef instances
in This is meant for internal usage, and is generally not of interest to subclasses.
| |
| Modifier and Type | Field and Description |
|---|---|
| protected int | |
| protected int | |
| protected Vector | |
| protected String |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | redo()
Overrides javax. Implements javax. Throws |
| public void | undo()
Overrides javax. Implements javax. Throws |
| length | back to summary |
|---|---|
| protected int length | |
| offset | back to summary |
|---|---|
| protected int offset | |
| posRefs | back to summary |
|---|---|
protected Vector<E> posRefs
| |
| string | back to summary |
|---|---|
| protected String string | |
| InsertUndo | back to summary |
|---|---|
| protected InsertUndo(int offset, int length) | |
| redo | back to summary |
|---|---|
| public void redo() throws CannotRedoException Overrides javax. Implements javax. Doc from javax. Throws
| |
| undo | back to summary |
|---|---|
| public void undo() throws CannotUndoException Overrides javax. Implements javax. Doc from javax. Throws
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| offset | back to summary |
|---|---|
| pack-priv int offset | |
| PosRec | back to summary |
|---|---|
| pack-priv PosRec(int offset, StringContent. | |
| Modifier and Type | Field and Description |
|---|---|
| protected int | |
| protected int | |
| protected Vector | |
| protected String |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | redo()
Overrides javax. Implements javax. Throws |
| public void | undo()
Overrides javax. Implements javax. Throws |
| length | back to summary |
|---|---|
| protected int length | |
| offset | back to summary |
|---|---|
| protected int offset | |
| posRefs | back to summary |
|---|---|
| protected Vector<StringContent. | |
| string | back to summary |
|---|---|
| protected String string | |
| RemoveUndo | back to summary |
|---|---|
protected RemoveUndo(int offset, String string)
| |
| redo | back to summary |
|---|---|
| public void redo() throws CannotRedoException Overrides javax. Implements javax. Doc from javax. Throws
| |
| undo | back to summary |
|---|---|
| public void undo() throws CannotUndoException Overrides javax. Implements javax. Doc from javax. Throws
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv StringContent. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | getOffset()
Implements javax. Fetches the current offset within the document. |
| public String |
| rec | back to summary |
|---|---|
| pack-priv StringContent. | |
| StickyPosition | back to summary |
|---|---|
| pack-priv StickyPosition(int offset) | |
| getOffset | back to summary |
|---|---|
| public int getOffset() Implements javax. Doc from javax. Fetches the current offset within the document. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| protected StringContent. | rec
Position to reset offset. |
| protected int | undoLocation
Location to reset to when resetLocation is invoked. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | resetLocation()
Resets the location of the Position to the offset when the receiver was instantiated. |
| rec | back to summary |
|---|---|
| protected StringContent. Position to reset offset. | |
| undoLocation | back to summary |
|---|---|
| protected int undoLocation Location to reset to when resetLocation is invoked. | |
| UndoPosRef | back to summary |
|---|---|
| pack-priv UndoPosRef(StringContent. | |
| resetLocation | back to summary |
|---|---|
| protected void resetLocation() Resets the location of the Position to the offset when the receiver was instantiated. | |