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) booleancompare only StringBuilder references for detecting change of the propertyvoidgetPositionsAsUndo(int pos, int len) getString(int where, int len) inthashCode()insertString(int where, String str) intlength()remove(int where, int nItems) <T> Tprotected voidupdatePositions(int pos, int adj, boolean insert)
-
Field Details
-
buffer
-
array
protected transient char[] array -
positions
-
-
Constructor Details
-
StringBuilderContent
-
-
Method Details
-
getBuffer
-
createPosition
- Specified by:
createPositionin interfaceAbstractDocument.Content
-
length
public int length()- Specified by:
lengthin interfaceAbstractDocument.Content
-
insertString
- Specified by:
insertStringin interfaceAbstractDocument.Content- Throws:
BadLocationException
-
remove
- Specified by:
removein interfaceAbstractDocument.Content- Throws:
BadLocationException
-
updatePositions
protected void updatePositions(int pos, int adj, boolean insert) -
getString
- Specified by:
getStringin interfaceAbstractDocument.Content- Throws:
BadLocationException
-
getChars
- Specified by:
getCharsin interfaceAbstractDocument.Content- Throws:
BadLocationException
-
run
- Throws:
BadLocationException
-
equals
compare only StringBuilder references for detecting change of the property -
hashCode
public int hashCode() -
getPositions
-
getPositionsAsUndo
-