Interface DelimiterRun

  • All Known Implementing Classes:
    Delimiter

    public interface DelimiterRun
    A delimiter run is one or more of the same delimiter character, e.g. ***.
    • Method Detail

      • canOpen

        boolean canOpen()
        Returns:
        whether this can open a delimiter
      • canClose

        boolean canClose()
        Returns:
        whether this can close a delimiter
      • length

        int length()
        Returns:
        the number of characters in this delimiter run (that are left for processing)
      • originalLength

        int originalLength()
        Returns:
        the number of characters originally in this delimiter run; at the start of processing, this is the same as {length()}
      • getOpener

        Text getOpener()
        Returns:
        the innermost opening delimiter, e.g. for *** this is the last *
      • getCloser

        Text getCloser()
        Returns:
        the innermost closing delimiter, e.g. for *** this is the first *
      • getOpeners

        java.lang.Iterable<Text> getOpeners​(int length)
        Get the opening delimiter nodes for the specified length of delimiters. Length must be between 1 and length().

        For example, for a delimiter run ***, calling this with 1 would return the last *. Calling it with 2 would return the second last * and the last *.

      • getClosers

        java.lang.Iterable<Text> getClosers​(int length)
        Get the closing delimiter nodes for the specified length of delimiters. Length must be between 1 and length().

        For example, for a delimiter run ***, calling this with 1 would return the first *. Calling it with 2 would return the first * and the second *.