Class Document

All Implemented Interfaces:
IDocument, IDocumentExtension, IDocumentExtension2, IDocumentExtension3, IDocumentExtension4, IRepairableDocument, IRepairableDocumentExtension

public class Document extends AbstractDocument
Default document implementation. Uses a GapTextStore wrapped inside a CopyOnWriteTextStore as text store.

The used line tracker considers the following strings as line delimiters: "\n", "\r", "\r\n". In case of a text replacement across line delimiter boundaries and with different line delimiters, the line tracker might have to be repaired. Use isLineInformationRepairNeeded(int, int, String) before doing the text replace if you have the need to discover such a situation.

The document is ready to use. It has a default position category for which a default position updater is installed.

Performance: The implementation should perform reasonably well for typical source code documents. It is not designed for very large documents of a size of several megabytes. Space-saving implementations are initially used for both the text store and the line tracker; the first modification after a set incurs the cost to transform the document structures to efficiently handle updates.

See GapTextStore and TreeLineTracker for algorithmic behavior of the used document structures.

See Also: