public class

StaticTextDocument

extends AbstractTextDocument
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.events.EventSource
     ↳ com.pnfsoftware.jeb.core.output.text.impl.AbstractTextDocument
       ↳ com.pnfsoftware.jeb.core.output.text.impl.StaticTextDocument

Class Overview

A simple text document. Such text document objects do not listen to unit changes events; in fact, they are unaware of the IUnit family of classes. They are ideal to distribute static, immutable contents. More complex text documents should implement ITextDocument and/or extend AbstractTextDocument.

In this simple implementation, a line maps to one anchor. Therefore, the "line" part of a coordinates becomes redundant within the default addressing scheme provided by AbstractTextDocument. The addressing scheme has been simplified to "anchorId,columnOffset".

Summary

Public Constructors
StaticTextDocument(List<ILine> lines)
Public Methods
ICoordinates addressToCoordinates(String address)
Convert a unit-specific address to document-specific text coordinates.
String coordinatesToAddress(ICoordinates coordinates)
Convert document-specific text coordinates to a unit-specific address.
long getAnchorCount()
ITextDocumentPart getDocumentPart(long anchorId, int linesAfter, int linesBefore)
String toString()
[Expand]
Inherited Methods
From class com.pnfsoftware.jeb.core.output.text.impl.AbstractTextDocument
From class com.pnfsoftware.jeb.util.events.EventSource
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.output.IGenericDocument
From interface com.pnfsoftware.jeb.core.output.text.ITextDocument
From interface com.pnfsoftware.jeb.util.events.IEventSource

Public Constructors

public StaticTextDocument (List<ILine> lines)

Public Methods

public ICoordinates addressToCoordinates (String address)

Convert a unit-specific address to document-specific text coordinates. It is recommended to return canonical coordinates. The implementation might return approximate coordinates, ie the closest coordinates (in terms of distance) calculated as part of a best effort approach to minimizing the return of null values.

Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.

Parameters
address a textual address
Returns
  • the text coordinates, null on error

public String coordinatesToAddress (ICoordinates coordinates)

Convert document-specific text coordinates to a unit-specific address.

Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.

Parameters
coordinates the coordinates
Returns
  • the address, null on error

public long getAnchorCount ()

public ITextDocumentPart getDocumentPart (long anchorId, int linesAfter, int linesBefore)

public String toString ()