Interface StyleSpans<S>

    • Method Detail

      • length

        int length()
      • getSpanCount

        int getSpanCount()
      • getStyleSpan

        StyleSpan<S> getStyleSpan​(int index)
      • equals

        boolean equals​(java.lang.Object other)
        Two StyleSpans objects are considered equal if they contain equal number of StyleSpans and the StyleSpans are pairwise equal.
        Overrides:
        equals in class java.lang.Object
      • iterator

        default java.util.Iterator<StyleSpan<S>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<S>
      • append

        default StyleSpans<S> append​(S style,
                                     int length)
        Appends the given style to the end of the list of StyleSpan.
      • prepend

        default StyleSpans<S> prepend​(S style,
                                      int length)
        Prepends the given style to the start of the list of StyleSpan.
      • subView

        default StyleSpans<S> subView​(int from,
                                      int to)
        Same as List.subList(int, int)
      • mapStyles

        default StyleSpans<S> mapStyles​(java.util.function.UnaryOperator<S> mapper)
        Returns a new StyleSpans object that has the same total length as this StyleSpans and style of every span is mapped by the given function. Adjacent style spans whose style mapped to the same value are merged into one. As a consequence, the returned StyleSpans might have fewer style spans than this StyleSpans.
        Parameters:
        mapper - function to calculate new style
        Returns:
        StyleSpans with replaced styles.
      • overlay

        default StyleSpans<S> overlay​(StyleSpans<S> that,
                                      java.util.function.BiFunction<? super S,​? super S,​? extends S> f)
        Applies the given bifunction f to this object's StyleSpan objects and that StyleSpan objects and stores the result in the returned StyleSpans object.
      • styleStream

        default java.util.stream.Stream<S> styleStream()
        Returns a stream of just this list of StyleSpan's styles.
      • stream

        default java.util.stream.Stream<StyleSpan<S>> stream()
        Returns a stream of this list' StyleSpan objects.