String).
StyledDocument that does not allow editing. For a StyledDocument
that can be edited, see EditableStyledDocument. To create one, use its static factory
"from"-prefixed methods or ReadOnlyStyledDocumentBuilder.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class | ReadOnlyStyledDocument.
Private class used for calculating |
| Modifier and Type | Field and Description |
|---|---|
| private static final Pattern | |
| private static final BiFunction | |
| private List | |
| private String | |
| private final FingerTree. |
| Access | Constructor and Description |
|---|---|
| private | ReadOnlyStyledDocument(FingerTree.
|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public static < The type of the paragraph style. PS, The type of the segments in the paragraph (e.g. SEG, String).The type of the style of individual segments. S> Codec | codec(Codec<PS>
the codec for serializing a pCodec, Codec<StyledSegment<SEG, S>> Paragraphthe codec for serializing a segCodec, SegmentOps<SEG, S> StyledSegmentthe operations object for operating on segments segmentOps)Defines a codec for serializing a |
| public ReadOnlyStyledDocument | |
| private ReadOnlyStyledDocument | |
| private ReadOnlyStyledDocument | |
| private void | |
| private void | |
| private void | |
| public final boolean | equals(Object other)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public static < The type of the paragraph style. PS, The type of the segments in the paragraph (e.g. SEG, String).The type of the style of individual segments. S> ReadOnlyStyledDocument | |
| public static < The type of the paragraph style. PS, The type of the segments in the paragraph (e.g. SEG, String).The type of the style of individual segments. S> ReadOnlyStyledDocument | fromSegment(SEG
the only segment in the only paragraph in the document segment, PS the paragraph style to use for each paragraph in the returned document paragraphStyle, S the style to use for each segment in the document style, SegmentOps<SEG, S> the operations object that can create a segment froma given text segmentOps)Creates a |
| public static < The type of the paragraph style. PS, The type of the segments in the paragraph (e.g. SEG, String).The type of the style of individual segments. S> ReadOnlyStyledDocument | fromString(String
the text to use to create the segments str, PS the paragraph style to use for each paragraph in the returned document paragraphStyle, S the style to use for each segment in the document style, TextOps<SEG, S> the operations object that can create a segment froma given text segmentOps)Creates a |
| private int | |
| public Paragraph | |
| public int | |
| public List | |
| public String | |
| public final int | |
| public int | |
| public ReadOnlyStyledDocument | mapParagraphs(UnaryOperator<Paragraph<PS, SEG, S>> mapper)
Maps all of this document's paragraphs using the given mapper and returns them in a new
|
| public TwoDimensional. | offsetToPosition(int offset, TwoDimensional.
Implements org. Creates a two dimensional position in some entity (e.g. area, list of lists, list of some object with length)
where the |
| private static <PS, SEG, S> Codec | paragraphCodec(Codec<PS> pCodec, Codec<StyledSegment<SEG, S>> segCodec, SegmentOps<SEG, S> segmentOps)
|
| public TwoDimensional. | position(int major, int minor)
Implements org. Creates a two dimensional position in some entity (e.g. area, list of lists, list of some object with length)
where the |
| public Tuple3 | replace(Replacement<PS, SEG, S> replacement)
Convenience method for calling |
| public Tuple3 | replace(int from, int to, ReadOnlyStyledDocument<PS, SEG, S> replacement)
Replaces the given portion
|
| public Tuple3 | replace(int from, int to, UnaryOperator<ReadOnlyStyledDocument<PS, SEG, S>> mapper)
Replaces the given portion |
| public Tuple3 | replace(int paragraphIndex, int fromCol, int toCol, UnaryOperator<ReadOnlyStyledDocument<PS, SEG, S>> f)
|
| private Tuple3 | |
| public Tuple3 | replaceMulti(List<Replacement<PS, SEG, S>> replacements)
Replaces multiple portions of this document in an efficient manner and returns
|
| public Tuple3 | replaceParagraph(int parIdx, UnaryOperator<Paragraph<PS, SEG, S>> mapper)
Maps the paragraph at the given index by calling |
| public Tuple2 | |
| public Tuple2 | split(int paragraphIndex, int columnPosition)
Splits this document into two at the given paragraph's column position and returns both halves. |
| public StyledDocument | |
| private static <PS, SEG, S> ToSemigroup | summaryProvider()
Private method for quickly calculating the length of a portion (subdocument) of this document. |
| public String |
| LINE_TERMINATOR | back to summary |
|---|---|
| private static final Pattern LINE_TERMINATOR | |
| NAVIGATE | back to summary |
|---|---|
| private static final BiFunction<ReadOnlyStyledDocument. | |
| paragraphs | back to summary |
|---|---|
| private List<Paragraph<PS, SEG, S>> paragraphs | |
| text | back to summary |
|---|---|
| private String text | |
| tree | back to summary |
|---|---|
| private final FingerTree. | |
| ReadOnlyStyledDocument | back to summary |
|---|---|
| private ReadOnlyStyledDocument(FingerTree. | |
| ReadOnlyStyledDocument | back to summary |
|---|---|
| pack-priv ReadOnlyStyledDocument(List<Paragraph<PS, SEG, S>> paragraphs) | |
| codec | back to summary |
|---|---|
| public static <PS, SEG, S> Codec Defines a codec for serializing a
| |
| concat | back to summary |
|---|---|
| public ReadOnlyStyledDocument Implements org.
| |
| concat0 | back to summary |
|---|---|
| private ReadOnlyStyledDocument | |
| concatR | back to summary |
|---|---|
| private ReadOnlyStyledDocument | |
| ensureValidParagraphIndex | back to summary |
|---|---|
| private void ensureValidParagraphIndex(int parIdx) | |
| ensureValidParagraphRange | back to summary |
|---|---|
| private void ensureValidParagraphRange(int par, int start, int end) | |
| ensureValidRange | back to summary |
|---|---|
| private void ensureValidRange(int start, int end) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| from | back to summary |
|---|---|
| public static <PS, SEG, S> ReadOnlyStyledDocument Creates a
| |
| fromSegment | back to summary |
|---|---|
| public static <PS, SEG, S> ReadOnlyStyledDocument Creates a
| |
| fromString | back to summary |
|---|---|
| public static <PS, SEG, S> ReadOnlyStyledDocument Creates a
| |
| fullLength | back to summary |
|---|---|
| private int fullLength(int par) | |
| getParagraph | back to summary |
|---|---|
| public Paragraph Overrides default org. | |
| getParagraphCount | back to summary |
|---|---|
| public int getParagraphCount() | |
| getParagraphs | back to summary |
|---|---|
| public List Implements org.
| |
| getText | back to summary |
|---|---|
| public String getText() Implements org.
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| length | back to summary |
|---|---|
| public int length() Implements org.
| |
| mapParagraphs | back to summary |
|---|---|
| public ReadOnlyStyledDocument Maps all of this document's paragraphs using the given mapper and returns them in a new
| |
| offsetToPosition | back to summary |
|---|---|
| public TwoDimensional. Implements org. Doc from org. Creates a two dimensional position in some entity (e.g. area, list of lists, list of some object with length)
where the
| |
| paragraphCodec | back to summary |
|---|---|
| private static <PS, SEG, S> Codec | |
| position | back to summary |
|---|---|
| public TwoDimensional. Implements org. Doc from org. Creates a two dimensional position in some entity (e.g. area, list of lists, list of some object with length)
where the
| |
| replace | back to summary |
|---|---|
| public Tuple3 Convenience method for calling | |
| replace | back to summary |
|---|---|
| public Tuple3 Replaces the given portion
| |
| replace | back to summary |
|---|---|
| public Tuple3 Replaces the given portion
| |
| replace | back to summary |
|---|---|
| public Tuple3 | |
| replace | back to summary |
|---|---|
| private Tuple3 | |
| replaceMulti | back to summary |
|---|---|
| public Tuple3 Replaces multiple portions of this document in an efficient manner and returns
| |
| replaceParagraph | back to summary |
|---|---|
| public Tuple3 Maps the paragraph at the given index by calling
| |
| split | back to summary |
|---|---|
| public Tuple2 Splits this document into two at the given position and returns both halves. | |
| split | back to summary |
|---|---|
| public Tuple2 Splits this document into two at the given paragraph's column position and returns both halves. | |
| subSequence | back to summary |
|---|---|
| public StyledDocument Implements org.
| |
| summaryProvider | back to summary |
|---|---|
| private static <PS, SEG, S> ToSemigroup Private method for quickly calculating the length of a portion (subdocument) of this document. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public TwoDimensional. | clamp()
Implements org. Returns a new position which clamps the minor position to be valid given the major position. |
| public int | getMajor()
Implements org. The major dimension, e.g. paragraph number within a document |
| public int | getMinor()
Implements org. The minor dimension, e.g. segment index or column offset within a paragraph. |
| public TwoDimensional | getTargetObject()
Implements org. The TwoDimensional object that this position refers to. |
| public TwoDimensional. | offsetBy(int amount, TwoDimensional.
Implements org. Returns a new position that offsets this position by the given amount |
| public boolean | sameAs(TwoDimensional.
Implements org. Returns |
| public int | toOffset()
Implements org. Converts this position to an overall offset within the original
TwoDimensional item (to which |
| public String |
| major | back to summary |
|---|---|
| private final int major | |
| minor | back to summary |
|---|---|
| private final int minor | |
| Pos | back to summary |
|---|---|
| private Pos(int major, int minor) | |
| clamp | back to summary |
|---|---|
| public TwoDimensional. Implements org. Doc from org. Returns a new position which clamps the minor position to be valid given the major position. (i.e. if the position is beyond the end of a given paragraph, moves the position back to the end of the paragraph).
| |
| getMajor | back to summary |
|---|---|
| public int getMajor() Implements org. Doc from org. The major dimension, e.g. paragraph number within a document
| |
| getMinor | back to summary |
|---|---|
| public int getMinor() Implements org. Doc from org. The minor dimension, e.g. segment index or column offset within a paragraph.
| |
| getTargetObject | back to summary |
|---|---|
| public TwoDimensional getTargetObject() Implements org. Doc from org. The TwoDimensional object that this position refers to.
| |
| offsetBy | back to summary |
|---|---|
| public TwoDimensional. Implements org. Doc from org. Returns a new position that offsets this position by the given amount
| |
| sameAs | back to summary |
|---|---|
| public boolean sameAs(TwoDimensional. Implements org. Doc from org. Returns
| |
| toOffset | back to summary |
|---|---|
| public int toOffset() Implements org. Doc from org. Converts this position to an overall offset within the original
TwoDimensional item (to which
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
TwoDimensional.Position s within this document.
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int |
| charCount | back to summary |
|---|---|
| private final int charCount | |
| paragraphCount | back to summary |
|---|---|
| private final int paragraphCount | |
| Summary | back to summary |
|---|---|
| public Summary(int paragraphCount, int charCount) | |
| length | back to summary |
|---|---|
| public int length() | |