Top Description Inners Fields Constructors Methods
org.fxmisc.richtext.model

public final Class ReadOnlyStyledDocument<PS, SEG, S>

extends Object
implements StyledDocument<PS, SEG, S>
Class Inheritance
All Implemented Interfaces
org.fxmisc.richtext.model.StyledDocument, org.fxmisc.richtext.model.TwoDimensional
Type Parameters
<PS>
The type of the paragraph style.
<SEG>
The type of the segments in the paragraph (e.g. String).
<S>
The type of the style of individual segments.
Static Imports
org.reactfx.util.Either.*, org.reactfx.util.Tuples.*

An immutable implementation of 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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class
ReadOnlyStyledDocument.Summary

Private class used for calculating TwoDimensional.Positions within this document.

Field Summary

Modifier and TypeField and Description
private static final Pattern
private List<Paragraph<PS, SEG, S>>
private String
private final FingerTree.NonEmptyFingerTree<Paragraph<PS, SEG, S>, ReadOnlyStyledDocument.Summary>

Constructor Summary

AccessConstructor and Description
private
pack-priv
ReadOnlyStyledDocument(List<Paragraph<PS, SEG, S>> paragraphs)

Method Summary

Modifier and TypeMethod and Description
public static <
The type of the paragraph style.
PS
,
The type of the segments in the paragraph (e.g. String).
SEG
,
The type of the style of individual segments.
S
>
Codec<StyledDocument<PS, SEG, S>>
codec(Codec<PS>
the codec for serializing a Paragraph
pCodec
,
Codec<StyledSegment<SEG, S>>
the codec for serializing a StyledSegment
segCodec
,
SegmentOps<SEG, S>
the operations object for operating on segments
segmentOps
)

Defines a codec for serializing a ReadOnlyStyledDocument.

public ReadOnlyStyledDocument<PS, SEG, S>
private ReadOnlyStyledDocument<PS, SEG, S>
concat0(StyledDocument<PS, SEG, S> other, BinaryOperator<Paragraph<PS, SEG, S>> parConcat)

private ReadOnlyStyledDocument<PS, SEG, S>
concatR(StyledDocument<PS, SEG, S> other)

private void
private void
ensureValidParagraphRange(int par, int start, int end)

private void
ensureValidRange(int start, int end)

public final boolean
equals(Object other)

Overrides java.lang.Object.equals.

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. String).
SEG
,
The type of the style of individual segments.
S
>
ReadOnlyStyledDocument<PS, SEG, S>
from(StyledDocument<PS, SEG, S> doc)

Creates a ReadOnlyStyledDocument from the given StyledDocument.

public static <
The type of the paragraph style.
PS
,
The type of the segments in the paragraph (e.g. String).
SEG
,
The type of the style of individual segments.
S
>
ReadOnlyStyledDocument<PS, SEG, S>
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 ReadOnlyStyledDocument from the given segment.

public static <
The type of the paragraph style.
PS
,
The type of the segments in the paragraph (e.g. String).
SEG
,
The type of the style of individual segments.
S
>
ReadOnlyStyledDocument<PS, SEG, S>
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 ReadOnlyStyledDocument from the given string.

private int
fullLength(int par)

public Paragraph<PS, SEG, S>
public int
public List<Paragraph<PS, SEG, S>>
public String
public final int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public int
public ReadOnlyStyledDocument<PS, SEG, S>
mapParagraphs(UnaryOperator<Paragraph<PS, SEG, S>> mapper)

Maps all of this document's paragraphs using the given mapper and returns them in a new ReadOnlyStyledDocument.

public TwoDimensional.Position
offsetToPosition(int offset, TwoDimensional.Bias bias)

Implements org.fxmisc.richtext.model.TwoDimensional.offsetToPosition.

Creates a two dimensional position in some entity (e.g. area, list of lists, list of some object with length) where the offset value is an absolute position in that entity.

private static <PS, SEG, S> Codec<Paragraph<PS, SEG, S>>
paragraphCodec(Codec<PS> pCodec, Codec<StyledSegment<SEG, S>> segCodec, SegmentOps<SEG, S> segmentOps)

public TwoDimensional.Position
position(int major, int minor)

Implements org.fxmisc.richtext.model.TwoDimensional.position.

Creates a two dimensional position in some entity (e.g. area, list of lists, list of some object with length) where the major value is the index within the outer list) and the minor value is either the index within the inner list or some amount of length in a list of objects that have length.

public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>>
replace(Replacement<PS, SEG, S> replacement)

Convenience method for calling replace(int, int, ReadOnlyStyledDocument) with a Replacement argument.

public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>>
replace(int from, int to, ReadOnlyStyledDocument<PS, SEG, S> replacement)

Replaces the given portion "from..to" with the given replacement and returns

  1. the updated version of this document that includes the replacement,
  2. the RichTextChange that represents the change from this document to the returned one, and
  3. the modification used to update an area's list of paragraphs.
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>>
replace(int from, int to, UnaryOperator<ReadOnlyStyledDocument<PS, SEG, S>> mapper)

Replaces the given portion "from..to" in the document by getting that portion of this document, passing it into the mapping function, and using the result as the replacement.

public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>>
replace(int paragraphIndex, int fromCol, int toCol, UnaryOperator<ReadOnlyStyledDocument<PS, SEG, S>> f)

private Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>>
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, List<RichTextChange<PS, SEG, S>>, List<MaterializedListModification<Paragraph<PS, SEG, S>>>>
replaceMulti(List<Replacement<PS, SEG, S>> replacements)

Replaces multiple portions of this document in an efficient manner and returns

  1. the updated version of this document that includes all of the replacements,
  2. the List of RichTextChange that represent all the changes from this document to the returned one, and
  3. the List of modifications used to update an area's list of paragraphs for each change.
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>>
replaceParagraph(int parIdx, UnaryOperator<Paragraph<PS, SEG, S>> mapper)

Maps the paragraph at the given index by calling replace(int, int, UnaryOperator).

public Tuple2<ReadOnlyStyledDocument<PS, SEG, S>, ReadOnlyStyledDocument<PS, SEG, S>>
split(int position)

Splits this document into two at the given position and returns both halves.

public Tuple2<ReadOnlyStyledDocument<PS, SEG, S>, ReadOnlyStyledDocument<PS, SEG, S>>
split(int paragraphIndex, int columnPosition)

Splits this document into two at the given paragraph's column position and returns both halves.

public StyledDocument<PS, SEG, S>
private static <PS, SEG, S> ToSemigroup<Paragraph<PS, SEG, S>, ReadOnlyStyledDocument.Summary>
summaryProvider()

Private method for quickly calculating the length of a portion (subdocument) of this document.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

LINE_TERMINATORback to summary
private static final Pattern LINE_TERMINATOR
paragraphsback to summary
private List<Paragraph<PS, SEG, S>> paragraphs
textback to summary
private String text
treeback to summary
private final FingerTree.NonEmptyFingerTree<Paragraph<PS, SEG, S>, ReadOnlyStyledDocument.Summary> tree

Constructor Detail

ReadOnlyStyledDocumentback to summary
private ReadOnlyStyledDocument(FingerTree.NonEmptyFingerTree<Paragraph<PS, SEG, S>, ReadOnlyStyledDocument.Summary> tree)
ReadOnlyStyledDocumentback to summary
pack-priv ReadOnlyStyledDocument(List<Paragraph<PS, SEG, S>> paragraphs)

Method Detail

codecback to summary
public static <PS, SEG, S> Codec<StyledDocument<PS, SEG, S>> codec(Codec<PS> pCodec, Codec<StyledSegment<SEG, S>> segCodec, SegmentOps<SEG, S> segmentOps)

Defines a codec for serializing a ReadOnlyStyledDocument.

Parameters
<PS>
The type of the paragraph style.
<SEG>
The type of the segments in the paragraph (e.g. String).
<S>
The type of the style of individual segments.
pCodec:Codec<PS>

the codec for serializing a Paragraph

segCodec:Codec<StyledSegment<SEG, S>>

the codec for serializing a StyledSegment

segmentOps:SegmentOps<SEG, S>

the operations object for operating on segments

concatback to summary
public ReadOnlyStyledDocument<PS, SEG, S> concat(StyledDocument<PS, SEG, S> other)

Implements org.fxmisc.richtext.model.StyledDocument.concat.

Annotations
@Override
concat0back to summary
private ReadOnlyStyledDocument<PS, SEG, S> concat0(StyledDocument<PS, SEG, S> other, BinaryOperator<Paragraph<PS, SEG, S>> parConcat)
concatRback to summary
private ReadOnlyStyledDocument<PS, SEG, S> concatR(StyledDocument<PS, SEG, S> other)
ensureValidParagraphIndexback to summary
private void ensureValidParagraphIndex(int parIdx)
ensureValidParagraphRangeback to summary
private void ensureValidParagraphRange(int par, int start, int end)
ensureValidRangeback to summary
private void ensureValidRange(int start, int end)
equalsback to summary
public final boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

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.

Annotations
@Override
fromback to summary
public static <PS, SEG, S> ReadOnlyStyledDocument<PS, SEG, S> from(StyledDocument<PS, SEG, S> doc)

Creates a ReadOnlyStyledDocument from the given StyledDocument.

Parameters
<PS>
The type of the paragraph style.
<SEG>
The type of the segments in the paragraph (e.g. String).
<S>
The type of the style of individual segments.
fromSegmentback to summary
public static <PS, SEG, S> ReadOnlyStyledDocument<PS, SEG, S> fromSegment(SEG segment, PS paragraphStyle, S style, SegmentOps<SEG, S> segmentOps)

Creates a ReadOnlyStyledDocument from the given segment.

Parameters
<PS>
The type of the paragraph style.
<SEG>
The type of the segments in the paragraph (e.g. String).
<S>
The type of the style of individual segments.
segment:SEG

the only segment in the only paragraph in the document

paragraphStyle:PS

the paragraph style to use for each paragraph in the returned document

style:S

the style to use for each segment in the document

segmentOps:SegmentOps<SEG, S>

the operations object that can create a segment froma given text

fromStringback to summary
public static <PS, SEG, S> ReadOnlyStyledDocument<PS, SEG, S> fromString(String str, PS paragraphStyle, S style, TextOps<SEG, S> segmentOps)

Creates a ReadOnlyStyledDocument from the given string.

Parameters
<PS>
The type of the paragraph style.
<SEG>
The type of the segments in the paragraph (e.g. String).
<S>
The type of the style of individual segments.
str:String

the text to use to create the segments

paragraphStyle:PS

the paragraph style to use for each paragraph in the returned document

style:S

the style to use for each segment in the document

segmentOps:TextOps<SEG, S>

the operations object that can create a segment froma given text

fullLengthback to summary
private int fullLength(int par)
getParagraphback to summary
public Paragraph<PS, SEG, S> getParagraph(int index)

Overrides default org.fxmisc.richtext.model.StyledDocument.getParagraph.

getParagraphCountback to summary
public int getParagraphCount()
getParagraphsback to summary
public List<Paragraph<PS, SEG, S>> getParagraphs()

Implements org.fxmisc.richtext.model.StyledDocument.getParagraphs.

Annotations
@Override
getTextback to summary
public String getText()

Implements org.fxmisc.richtext.model.StyledDocument.getText.

Annotations
@Override
hashCodeback to summary
public final int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
lengthback to summary
public int length()

Implements org.fxmisc.richtext.model.StyledDocument.length.

Annotations
@Override
mapParagraphsback to summary
public ReadOnlyStyledDocument<PS, SEG, S> mapParagraphs(UnaryOperator<Paragraph<PS, SEG, S>> mapper)

Maps all of this document's paragraphs using the given mapper and returns them in a new ReadOnlyStyledDocument.

offsetToPositionback to summary
public TwoDimensional.Position offsetToPosition(int offset, TwoDimensional.Bias bias)

Implements org.fxmisc.richtext.model.TwoDimensional.offsetToPosition.

Doc from org.fxmisc.richtext.model.TwoDimensional.offsetToPosition.

Creates a two dimensional position in some entity (e.g. area, list of lists, list of some object with length) where the offset value is an absolute position in that entity.

Annotations
@Override
paragraphCodecback to summary
private static <PS, SEG, S> Codec<Paragraph<PS, SEG, S>> paragraphCodec(Codec<PS> pCodec, Codec<StyledSegment<SEG, S>> segCodec, SegmentOps<SEG, S> segmentOps)
positionback to summary
public TwoDimensional.Position position(int major, int minor)

Implements org.fxmisc.richtext.model.TwoDimensional.position.

Doc from org.fxmisc.richtext.model.TwoDimensional.position.

Creates a two dimensional position in some entity (e.g. area, list of lists, list of some object with length) where the major value is the index within the outer list) and the minor value is either the index within the inner list or some amount of length in a list of objects that have length.

Annotations
@Override
replaceback to summary
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replace(Replacement<PS, SEG, S> replacement)

Convenience method for calling replace(int, int, ReadOnlyStyledDocument) with a Replacement argument.

replaceback to summary
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replace(int from, int to, ReadOnlyStyledDocument<PS, SEG, S> replacement)

Replaces the given portion "from..to" with the given replacement and returns

  1. the updated version of this document that includes the replacement,
  2. the RichTextChange that represents the change from this document to the returned one, and
  3. the modification used to update an area's list of paragraphs.
replaceback to summary
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replace(int from, int to, UnaryOperator<ReadOnlyStyledDocument<PS, SEG, S>> mapper)

Replaces the given portion "from..to" in the document by getting that portion of this document, passing it into the mapping function, and using the result as the replacement. Returns

  1. the updated version of this document that includes the replacement,
  2. the RichTextChange that represents the change from this document to the returned one, and
  3. the modification used to update an area's list of paragraphs.
replaceback to summary
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replace(int paragraphIndex, int fromCol, int toCol, UnaryOperator<ReadOnlyStyledDocument<PS, SEG, S>> f)
replaceback to summary
private Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replace(BiIndex start, BiIndex end, UnaryOperator<ReadOnlyStyledDocument<PS, SEG, S>> f)
replaceMultiback to summary
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, List<RichTextChange<PS, SEG, S>>, List<MaterializedListModification<Paragraph<PS, SEG, S>>>> replaceMulti(List<Replacement<PS, SEG, S>> replacements)

Replaces multiple portions of this document in an efficient manner and returns

  1. the updated version of this document that includes all of the replacements,
  2. the List of RichTextChange that represent all the changes from this document to the returned one, and
  3. the List of modifications used to update an area's list of paragraphs for each change.
replaceParagraphback to summary
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replaceParagraph(int parIdx, UnaryOperator<Paragraph<PS, SEG, S>> mapper)

Maps the paragraph at the given index by calling replace(int, int, UnaryOperator). Returns

  1. the updated version of this document that includes the replacement,
  2. the RichTextChange that represents the change from this document to the returned one, and
  3. the modification used to update an area's list of paragraphs.
splitback to summary
public Tuple2<ReadOnlyStyledDocument<PS, SEG, S>, ReadOnlyStyledDocument<PS, SEG, S>> split(int position)

Splits this document into two at the given position and returns both halves.

splitback to summary
public Tuple2<ReadOnlyStyledDocument<PS, SEG, S>, ReadOnlyStyledDocument<PS, SEG, S>> split(int paragraphIndex, int columnPosition)

Splits this document into two at the given paragraph's column position and returns both halves.

subSequenceback to summary
public StyledDocument<PS, SEG, S> subSequence(int start, int end)

Implements org.fxmisc.richtext.model.StyledDocument.subSequence.

Annotations
@Override
summaryProviderback to summary
private static <PS, SEG, S> ToSemigroup<Paragraph<PS, SEG, S>, ReadOnlyStyledDocument.Summary> summaryProvider()

Private method for quickly calculating the length of a portion (subdocument) of this document.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
org.fxmisc.richtext.model back to summary

private Class ReadOnlyStyledDocument.Pos

extends Object
implements Position
Class Inheritance
All Implemented Interfaces
org.fxmisc.richtext.model.TwoDimensional.Position

Field Summary

Modifier and TypeField and Description
private final int
private final int

Constructor Summary

AccessConstructor and Description
private
Pos(int major, int minor)

Method Summary

Modifier and TypeMethod and Description
public TwoDimensional.Position
clamp()

Implements org.fxmisc.richtext.model.TwoDimensional.Position.clamp.

Returns a new position which clamps the minor position to be valid given the major position.

public int
getMajor()

Implements org.fxmisc.richtext.model.TwoDimensional.Position.getMajor.

The major dimension, e.g. paragraph number within a document

public int
getMinor()

Implements org.fxmisc.richtext.model.TwoDimensional.Position.getMinor.

The minor dimension, e.g. segment index or column offset within a paragraph.

public TwoDimensional
getTargetObject()

Implements org.fxmisc.richtext.model.TwoDimensional.Position.getTargetObject.

The TwoDimensional object that this position refers to.

public TwoDimensional.Position
offsetBy(int amount, TwoDimensional.Bias bias)

Implements org.fxmisc.richtext.model.TwoDimensional.Position.offsetBy.

Returns a new position that offsets this position by the given amount

public boolean
sameAs(TwoDimensional.Position other)

Implements org.fxmisc.richtext.model.TwoDimensional.Position.sameAs.

Returns true if the given position is equal to this position, that is they both point to the same place in the same two-dimensional object.

public int
toOffset()

Implements org.fxmisc.richtext.model.TwoDimensional.Position.toOffset.

Converts this position to an overall offset within the original TwoDimensional item (to which getTargetObject refers).

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

majorback to summary
private final int major
minorback to summary
private final int minor

Constructor Detail

Posback to summary
private Pos(int major, int minor)

Method Detail

clampback to summary
public TwoDimensional.Position clamp()

Implements org.fxmisc.richtext.model.TwoDimensional.Position.clamp.

Doc from org.fxmisc.richtext.model.TwoDimensional.Position.clamp.

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).

Annotations
@Override
getMajorback to summary
public int getMajor()

Implements org.fxmisc.richtext.model.TwoDimensional.Position.getMajor.

Doc from org.fxmisc.richtext.model.TwoDimensional.Position.getMajor.

The major dimension, e.g. paragraph number within a document

Annotations
@Override
getMinorback to summary
public int getMinor()

Implements org.fxmisc.richtext.model.TwoDimensional.Position.getMinor.

Doc from org.fxmisc.richtext.model.TwoDimensional.Position.getMinor.

The minor dimension, e.g. segment index or column offset within a paragraph.

Annotations
@Override
getTargetObjectback to summary
public TwoDimensional getTargetObject()

Implements org.fxmisc.richtext.model.TwoDimensional.Position.getTargetObject.

Doc from org.fxmisc.richtext.model.TwoDimensional.Position.getTargetObject.

The TwoDimensional object that this position refers to.

Annotations
@Override
offsetByback to summary
public TwoDimensional.Position offsetBy(int amount, TwoDimensional.Bias bias)

Implements org.fxmisc.richtext.model.TwoDimensional.Position.offsetBy.

Doc from org.fxmisc.richtext.model.TwoDimensional.Position.offsetBy.

Returns a new position that offsets this position by the given amount

Annotations
@Override
sameAsback to summary
public boolean sameAs(TwoDimensional.Position other)

Implements org.fxmisc.richtext.model.TwoDimensional.Position.sameAs.

Doc from org.fxmisc.richtext.model.TwoDimensional.Position.sameAs.

Returns true if the given position is equal to this position, that is they both point to the same place in the same two-dimensional object. Otherwise returns false.

Annotations
@Override
toOffsetback to summary
public int toOffset()

Implements org.fxmisc.richtext.model.TwoDimensional.Position.toOffset.

Doc from org.fxmisc.richtext.model.TwoDimensional.Position.toOffset.

Converts this position to an overall offset within the original TwoDimensional item (to which getTargetObject refers). For example, moving a caret to a relative position (paragraph 2, column 3) might result in the offset value (absolute position) of 28.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
org.fxmisc.richtext.model back to summary

private Class ReadOnlyStyledDocument.Summary

extends Object
Class Inheritance

Private class used for calculating TwoDimensional.Positions within this document.

Field Summary

Modifier and TypeField and Description
private final int
private final int

Constructor Summary

AccessConstructor and Description
public
Summary(int paragraphCount, int charCount)

Method Summary

Modifier and TypeMethod and Description
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

charCountback to summary
private final int charCount
paragraphCountback to summary
private final int paragraphCount

Constructor Detail

Summaryback to summary
public Summary(int paragraphCount, int charCount)

Method Detail

lengthback to summary
public int length()