Module org.autogui
Package org.autogui.swing.mapping
Class GuiReprValueDocumentEditor.StringBuilderContent
java.lang.Object
org.autogui.swing.mapping.GuiReprValueDocumentEditor.StringBuilderContent
- All Implemented Interfaces:
Serializable
,AbstractDocument.Content
- Enclosing class:
GuiReprValueDocumentEditor
public static class GuiReprValueDocumentEditor.StringBuilderContent
extends Object
implements AbstractDocument.Content, Serializable
a content for
StringBuilder
:
wraps a buffer and manages any changes to the buffer.
Other changes to the buffer outside of class will cause unexpected behavior.
Thus, the client code must not modify contents of the buffer.
Also, when the class modified the buffer (usually in the event thread),
it acquires the monitor of the buffer by synchronized.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePosition
(int offset) boolean
compare only StringBuilder references for detecting change of the propertyvoid
getPositionsAsUndo
(int pos, int len) getString
(int where, int len) int
hashCode()
insertString
(int where, String str) int
length()
remove
(int where, int nItems) <T> T
protected void
updatePositions
(int pos, int adj, boolean insert)
-
Field Details
-
buffer
-
array
protected transient char[] array -
positions
-
-
Constructor Details
-
StringBuilderContent
-
-
Method Details
-
getBuffer
-
createPosition
- Specified by:
createPosition
in interfaceAbstractDocument.Content
-
length
public int length()- Specified by:
length
in interfaceAbstractDocument.Content
-
insertString
- Specified by:
insertString
in interfaceAbstractDocument.Content
- Throws:
BadLocationException
-
remove
- Specified by:
remove
in interfaceAbstractDocument.Content
- Throws:
BadLocationException
-
updatePositions
protected void updatePositions(int pos, int adj, boolean insert) -
getString
- Specified by:
getString
in interfaceAbstractDocument.Content
- Throws:
BadLocationException
-
getChars
- Specified by:
getChars
in interfaceAbstractDocument.Content
- Throws:
BadLocationException
-
run
- Throws:
BadLocationException
-
equals
compare only StringBuilder references for detecting change of the property -
hashCode
public int hashCode() -
getPositions
-
getPositionsAsUndo
-