AbstractDocument.Content (Java SE 15 & JDK 15) (original) (raw)

All Known Implementing Classes:

[GapContent](GapContent.html "class in javax.swing.text"), [StringContent](StringContent.html "class in javax.swing.text")

Enclosing class:

AbstractDocument


public static interface AbstractDocument.Content

Interface to describe a sequence of character content that can be edited. Implementations may or may not support a history mechanism which will be reflected by whether or not mutations return an UndoableEdit implementation.

See Also:

AbstractDocument

Modifier and Type Method Description
Position createPosition​(int offset) Creates a position within the content that will track change as the content is mutated.
void getChars​(int where, int len,Segment txt) Gets a sequence of characters and copies them into a Segment.
String getString​(int where, int len) Fetches a string of characters contained in the sequence.
UndoableEdit insertString​(int where,String str) Inserts a string of characters into the sequence.
int length() Current length of the sequence of character content.
UndoableEdit remove​(int where, int nitems) Removes some portion of the sequence.