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

public Class StyleSpansBuilder<S>

Additional top-level classes in compilation unit: StyleSpansBase, SubSpans, AppendedSpans, PrependedSpans, UpdatedSpans, SingletonSpans.

extends Object
Class Inheritance
Type Parameters
<S>
the segment style type
Imports
java.util.ArrayList, .Collection, .Collections, .Iterator, .List, java.util.function.BiFunction, javafx.scene.control.IndexRange

A one-time-use builder that Builds a memory efficient StyleSpans object.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private boolean
private final ArrayList<StyleSpan<S>>

Constructor Summary

AccessConstructor and Description
public
StyleSpansBuilder(int initialCapacity)

public

Method Summary

Modifier and TypeMethod and Description
private void
_add(StyleSpan<S> span)

public StyleSpansBuilder<S>
add(StyleSpan<S> styleSpan)

public StyleSpansBuilder<S>
add(S style, int length)

public StyleSpansBuilder<S>
addAll(Collection<? extends StyleSpan<S>> styleSpans)

public StyleSpansBuilder<S>
addAll(Iterable<? extends StyleSpan<S>> styleSpans, int sizeHint)

public StyleSpansBuilder<S>
addAll(Iterable<? extends StyleSpan<S>> styleSpans)

public StyleSpansBuilder<S>
addAll(Iterator<? extends StyleSpan<S>> styleSpans)

public StyleSpans<S>
private void
pack-priv static <S> StyleSpans<S>
overlay(StyleSpans<S> s1, StyleSpans<S> s2, BiFunction<? super S, ? super S, ? extends S> f)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

createdback to summary
private boolean created
spansback to summary
private final ArrayList<StyleSpan<S>> spans

Constructor Detail

StyleSpansBuilderback to summary
public StyleSpansBuilder(int initialCapacity)
StyleSpansBuilderback to summary
public StyleSpansBuilder()

Method Detail

_addback to summary
private void _add(StyleSpan<S> span)
addback to summary
public StyleSpansBuilder<S> add(StyleSpan<S> styleSpan)
addback to summary
public StyleSpansBuilder<S> add(S style, int length)
addAllback to summary
public StyleSpansBuilder<S> addAll(Collection<? extends StyleSpan<S>> styleSpans)
addAllback to summary
public StyleSpansBuilder<S> addAll(Iterable<? extends StyleSpan<S>> styleSpans, int sizeHint)
addAllback to summary
public StyleSpansBuilder<S> addAll(Iterable<? extends StyleSpan<S>> styleSpans)
addAllback to summary
public StyleSpansBuilder<S> addAll(Iterator<? extends StyleSpan<S>> styleSpans)
createback to summary
public StyleSpans<S> create()
ensureNotCreatedback to summary
private void ensureNotCreated()
overlayback to summary
pack-priv static <S> StyleSpans<S> overlay(StyleSpans<S> s1, StyleSpans<S> s2, BiFunction<? super S, ? super S, ? extends S> f)
org.fxmisc.richtext.model back to summary

private Class StyleSpansBuilder.StyleSpansImpl<S>

extends StyleSpansBase<S>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private int
private final List<StyleSpan<S>>
Inherited from org.fxmisc.richtext.model.StyleSpansBase:
navigator

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
public StyleSpan<S>
public Iterator<StyleSpan<S>>
iterator()

Overrides default org.fxmisc.richtext.model.StyleSpans.iterator.

Returns an iterator over elements of type T.

public int
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.fxmisc.richtext.model.StyleSpansBase:
equalsgetStyleRangehashCodeoffsetToPositionposition

Field Detail

lengthback to summary
private int length
spansback to summary
private final List<StyleSpan<S>> spans

Constructor Detail

StyleSpansImplback to summary
pack-priv StyleSpansImpl(List<StyleSpan<S>> spans)

Method Detail

getSpanCountback to summary
public int getSpanCount()

Implements org.fxmisc.richtext.model.StyleSpans.getSpanCount.

Annotations
@Override
getStyleSpanback to summary
public StyleSpan<S> getStyleSpan(int index)

Implements org.fxmisc.richtext.model.StyleSpans.getStyleSpan.

Annotations
@Override
iteratorback to summary
public Iterator<StyleSpan<S>> iterator()

Overrides default org.fxmisc.richtext.model.StyleSpans.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Annotations
@Override
lengthback to summary
public int length()

Implements org.fxmisc.richtext.model.StyleSpans.length.

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