Interface StyleSpans<S>

    • Method Detail

      • length

        int length()
      • getSpanCount

        int getSpanCount()
      • getStyleSpan

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

        IndexRange getStyleRange​(int position)
        Parameters:
        position - is relative to start of style spans
        Returns:
        IndexRange relative to start of style spans
      • equals

        boolean equals​(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 Object
      • 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.
      • mapStyles

        default StyleSpans<S> mapStyles​(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.
      • styleStream

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