Interface TextSplitter


public interface TextSplitter

defines the interface of a method which separates a string into parts and stores them in a TextStore.

Hint:Typically a TextSplitter and a Formatter are used in tandem and communicate via a TextStore.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TextSplitter
    is an instance of a TextSplitter which does not split the incoming text at all, but appends it completely as a new part onto the given TextStore.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    split(TextStore dst, StringBuilder source, int start)
    separates the stretch of text defined by the suffix of source, starting at start into parts and stores the parts in dst.
  • Field Details

    • NULLSPLITTER

      static final TextSplitter NULLSPLITTER

      is an instance of a TextSplitter which does not split the incoming text at all, but appends it completely as a new part onto the given TextStore. The TextStore is not cleared before.

  • Method Details

    • split

      void split(TextStore dst, StringBuilder source, int start)

      separates the stretch of text defined by the suffix of source, starting at start into parts and stores the parts in dst.

      The method normally does not clear the TextStore, but implementations may choose to do so.

      Postcondition: Implementations of this method must treat source read-only.